SELECT 
  products.company_id as variant_id, 
  company_descr.i18n_company as variant 
FROM 
  cscart_products as products 
  LEFT JOIN cscart_company_descriptions as company_descr ON company_descr.company_id = products.company_id 
  AND company_descr.lang_code = 'en' 
  LEFT JOIN cscart_companies AS companies ON companies.company_id = products.company_id 
  INNER JOIN cscart_products_categories as products_categories ON products_categories.product_id = products.product_id 
  INNER JOIN cscart_categories ON cscart_categories.category_id = products_categories.category_id 
  AND (
    cscart_categories.usergroup_ids = '' 
    OR FIND_IN_SET(
      0, cscart_categories.usergroup_ids
    ) 
    OR FIND_IN_SET(
      1, cscart_categories.usergroup_ids
    )
  ) 
  AND cscart_categories.status IN ('A', 'H') 
  AND cscart_categories.storefront_id IN (0, 1) 
  LEFT JOIN cscart_tag_links AS tags_links ON tags_links.object_id = products.product_id 
  AND tags_links.object_type = 'P' 
  LEFT JOIN cscart_tags AS tags ON tags.tag_id = tags_links.tag_id 
WHERE 
  1 = 1 
  AND cscart_categories.category_id IN (267) 
  AND companies.status IN ('A') 
  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') 
  AND (
    tags.status = 'A' 
    OR tags.tag_id IS NULL
  ) 
  AND products.product_type != 'D' 
GROUP BY 
  products.company_id 
ORDER BY 
  company_descr.i18n_company ASC

Query time 0.00085

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost": 0.254940432,
    "filesort": {
      "sort_key": "company_descr.i18n_company",
      "temporary_table": {
        "nested_loop": [
          {
            "table": {
              "table_name": "cscart_categories",
              "access_type": "const",
              "possible_keys": ["PRIMARY", "c_status", "p_category_id"],
              "key": "PRIMARY",
              "key_length": "3",
              "used_key_parts": ["category_id"],
              "ref": ["const"],
              "rows": 1,
              "filtered": 100
            }
          },
          {
            "table": {
              "table_name": "products_categories",
              "access_type": "ref",
              "possible_keys": ["PRIMARY", "pt"],
              "key": "PRIMARY",
              "key_length": "3",
              "used_key_parts": ["category_id"],
              "ref": ["const"],
              "loops": 1,
              "rows": 109,
              "cost": 0.02255975,
              "filtered": 100
            }
          },
          {
            "table": {
              "table_name": "products",
              "access_type": "eq_ref",
              "possible_keys": ["PRIMARY", "status"],
              "key": "PRIMARY",
              "key_length": "3",
              "used_key_parts": ["product_id"],
              "ref": ["u985510652_ecartify_dev.products_categories.product_id"],
              "loops": 109,
              "rows": 1,
              "cost": 0.11879316,
              "filtered": 27.74274826,
              "attached_condition": "(products.usergroup_ids = '' or find_in_set(0,products.usergroup_ids) or find_in_set(1,products.usergroup_ids)) and products.`status` = 'A' and products.product_type <> 'D'"
            }
          },
          {
            "table": {
              "table_name": "company_descr",
              "access_type": "eq_ref",
              "possible_keys": ["PRIMARY"],
              "key": "PRIMARY",
              "key_length": "10",
              "used_key_parts": ["company_id", "lang_code"],
              "ref": ["u985510652_ecartify_dev.products.company_id", "const"],
              "loops": 30.23959647,
              "rows": 1,
              "cost": 0.027866705,
              "filtered": 100,
              "attached_condition": "trigcond(company_descr.lang_code = 'en')"
            }
          },
          {
            "table": {
              "table_name": "companies",
              "access_type": "eq_ref",
              "possible_keys": ["PRIMARY"],
              "key": "PRIMARY",
              "key_length": "4",
              "used_key_parts": ["company_id"],
              "ref": ["u985510652_ecartify_dev.products.company_id"],
              "loops": 30.23959647,
              "rows": 1,
              "cost": 0.027866705,
              "filtered": 100,
              "attached_condition": "companies.`status` = 'A'"
            }
          },
          {
            "table": {
              "table_name": "tags_links",
              "access_type": "ref",
              "possible_keys": ["PRIMARY"],
              "key": "PRIMARY",
              "key_length": "6",
              "used_key_parts": ["object_type", "object_id"],
              "ref": [
                "const",
                "u985510652_ecartify_dev.products_categories.product_id"
              ],
              "loops": 30.23959647,
              "rows": 1,
              "cost": 0.029987408,
              "filtered": 100,
              "attached_condition": "trigcond(tags_links.object_type = 'P')"
            }
          },
          {
            "table": {
              "table_name": "tags",
              "access_type": "eq_ref",
              "possible_keys": ["PRIMARY"],
              "key": "PRIMARY",
              "key_length": "3",
              "used_key_parts": ["tag_id"],
              "ref": ["u985510652_ecartify_dev.tags_links.tag_id"],
              "loops": 30.23959647,
              "rows": 1,
              "cost": 0.027866705,
              "filtered": 100,
              "attached_condition": "trigcond(tags.`status` = 'A' or tags.tag_id is null) and trigcond(trigcond(tags_links.tag_id is not null))"
            }
          }
        ]
      }
    }
  }
}

Result

variant_id variant
1 Store