SELECT 
  cscart_product_reviews.rating_value as variant_id, 
  cscart_product_review_start.rating_title as variant 
FROM 
  cscart_product_reviews 
  LEFT JOIN cscart_products as products ON products.product_id = cscart_product_reviews.product_id 
  INNER JOIN cscart_product_review_start ON cscart_product_review_start.rating_value = cscart_product_reviews.rating_value 
  AND lang_code = 'en' 
  LEFT JOIN cscart_companies AS companies ON companies.company_id = products.company_id 
  LEFT JOIN cscart_products_tag_categories as products_tag_categories ON products_tag_categories.product_id = products.product_id 
  LEFT JOIN cscart_categories ON cscart_categories.category_id = products_tag_categories.category_id 
  LEFT JOIN cscart_product_popularity as popularity ON popularity.product_id = products.product_id 
WHERE 
  1 = 1 
  AND cscart_categories.category_id IN (515) 
  AND companies.status IN ('A') 
  AND (
    products.amount > 0 
    OR products.tracking = 'D'
  ) 
  AND (
    products.usergroup_ids = '' 
    OR FIND_IN_SET(0, products.usergroup_ids) 
    OR FIND_IN_SET(1, products.usergroup_ids)
  ) 
  AND products.status IN ('A') 
GROUP BY 
  cscart_product_reviews.rating_value 
ORDER BY 
  cscart_product_review_start.rating_title DESC

Query time 0.65599

JSON explain

{
  "query_block": {
    "select_id": 1,
    "filesort": {
      "sort_key": "cscart_product_review_start.rating_title desc",
      "temporary_table": {
        "nested_loop": [
          {
            "table": {
              "table_name": "cscart_categories",
              "access_type": "const",
              "possible_keys": ["PRIMARY", "p_category_id"],
              "key": "PRIMARY",
              "key_length": "3",
              "used_key_parts": ["category_id"],
              "ref": ["const"],
              "rows": 1,
              "filtered": 100,
              "using_index": true
            }
          },
          {
            "table": {
              "table_name": "cscart_product_review_start",
              "access_type": "ALL",
              "rows": 10,
              "filtered": 100,
              "attached_condition": "cscart_product_review_start.lang_code = 'en'"
            }
          },
          {
            "table": {
              "table_name": "products_tag_categories",
              "access_type": "ref",
              "possible_keys": ["PRIMARY", "pt"],
              "key": "PRIMARY",
              "key_length": "3",
              "used_key_parts": ["category_id"],
              "ref": ["const"],
              "rows": 1451,
              "filtered": 100,
              "using_index": true
            }
          },
          {
            "table": {
              "table_name": "products",
              "access_type": "eq_ref",
              "possible_keys": ["PRIMARY", "status"],
              "key": "PRIMARY",
              "key_length": "3",
              "used_key_parts": ["product_id"],
              "ref": ["dev_db.products_tag_categories.product_id"],
              "rows": 1,
              "filtered": 51.89157104,
              "attached_condition": "(products.amount > 0 or products.tracking = 'D') and (products.usergroup_ids = '' or find_in_set(0,products.usergroup_ids) or find_in_set(1,products.usergroup_ids)) and products.`status` = 'A'"
            }
          },
          {
            "table": {
              "table_name": "companies",
              "access_type": "eq_ref",
              "possible_keys": ["PRIMARY"],
              "key": "PRIMARY",
              "key_length": "4",
              "used_key_parts": ["company_id"],
              "ref": ["dev_db.products.company_id"],
              "rows": 1,
              "filtered": 100,
              "attached_condition": "companies.`status` = 'A'"
            }
          },
          {
            "table": {
              "table_name": "cscart_product_reviews",
              "access_type": "ref",
              "possible_keys": ["idx_product_id"],
              "key": "idx_product_id",
              "key_length": "3",
              "used_key_parts": ["product_id"],
              "ref": ["dev_db.products_tag_categories.product_id"],
              "rows": 5,
              "filtered": 100,
              "attached_condition": "cscart_product_review_start.rating_value = cscart_product_reviews.rating_value"
            }
          }
        ]
      }
    }
  }
}

Result

variant_id variant
5 From 5 Stars
4 From 4 Stars
3 From 3 Stars