SELECT 
  SQL_CALC_FOUND_ROWS products.product_id, 
  products.amount, 
  descr1.product as product, 
  companies.company as company_name, 
  variation_group_products.group_id AS variation_group_id, 
  products.product_type, 
  products.parent_product_id 
FROM 
  cscart_products as products 
  LEFT JOIN cscart_product_descriptions as descr1 ON descr1.product_id = products.product_id 
  AND descr1.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) 
  INNER JOIN cscart_product_variation_group_products AS variation_group_products ON variation_group_products.product_id = products.product_id 
WHERE 
  1 
  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') 
  AND variation_group_products.group_id IN (
    1160, 1103, 1129, 1159, 1173, 1086, 1146, 
    1174, 1163, 1053, 1139, 1175, 1122, 
    1104, 1155, 1178, 1180, 1148, 1176
  ) 
  AND products.product_type != 'D' 
GROUP BY 
  products.product_id 
ORDER BY 
  NULL asc

Query time 0.00272

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "58.59"
    },
    "ordering_operation": {
      "using_filesort": false,
      "grouping_operation": {
        "using_temporary_table": true,
        "using_filesort": false,
        "nested_loop": [
          {
            "table": {
              "table_name": "companies",
              "access_type": "ALL",
              "possible_keys": [
                "PRIMARY"
              ],
              "rows_examined_per_scan": 10,
              "rows_produced_per_join": 1,
              "filtered": "10.00",
              "cost_info": {
                "read_cost": "1.46",
                "eval_cost": "0.10",
                "prefix_cost": "1.56",
                "data_read_per_join": "6K"
              },
              "used_columns": [
                "company_id",
                "status",
                "company"
              ],
              "attached_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`companies`.`status` = 'A')"
            }
          },
          {
            "table": {
              "table_name": "variation_group_products",
              "access_type": "range",
              "possible_keys": [
                "PRIMARY",
                "idx_group_id"
              ],
              "key": "idx_group_id",
              "used_key_parts": [
                "group_id"
              ],
              "key_length": "3",
              "rows_examined_per_scan": 60,
              "rows_produced_per_join": 60,
              "filtered": "100.00",
              "index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`variation_group_products`.`group_id` in (1160,1103,1129,1159,1173,1086,1146,1174,1163,1053,1139,1175,1122,1104,1155,1178,1180,1148,1176))",
              "using_join_buffer": "hash join",
              "cost_info": {
                "read_cost": "25.76",
                "eval_cost": "6.00",
                "prefix_cost": "33.32",
                "data_read_per_join": "960"
              },
              "used_columns": [
                "product_id",
                "group_id"
              ]
            }
          },
          {
            "table": {
              "table_name": "products",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY",
                "status"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "product_id"
              ],
              "key_length": "3",
              "ref": [
                "softwarepirmam_hewadelivard_cscart_4.variation_group_products.product_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 3,
              "filtered": "5.00",
              "cost_info": {
                "read_cost": "15.00",
                "eval_cost": "0.30",
                "prefix_cost": "54.32",
                "data_read_per_join": "13K"
              },
              "used_columns": [
                "product_id",
                "product_type",
                "status",
                "company_id",
                "amount",
                "usergroup_ids",
                "tracking",
                "parent_product_id"
              ],
              "attached_condition": "((`softwarepirmam_hewadelivard_cscart_4`.`products`.`company_id` = `softwarepirmam_hewadelivard_cscart_4`.`companies`.`company_id`) and ((`softwarepirmam_hewadelivard_cscart_4`.`products`.`amount` > 0) or (`softwarepirmam_hewadelivard_cscart_4`.`products`.`tracking` = 'D')) and ((`softwarepirmam_hewadelivard_cscart_4`.`products`.`usergroup_ids` = '') or (0 <> find_in_set(0,`softwarepirmam_hewadelivard_cscart_4`.`products`.`usergroup_ids`)) or (0 <> find_in_set(1,`softwarepirmam_hewadelivard_cscart_4`.`products`.`usergroup_ids`))) and (`softwarepirmam_hewadelivard_cscart_4`.`products`.`status` = 'A') and (`softwarepirmam_hewadelivard_cscart_4`.`products`.`product_type` <> 'D'))"
            }
          },
          {
            "table": {
              "table_name": "products_categories",
              "access_type": "ref",
              "possible_keys": [
                "PRIMARY",
                "pt"
              ],
              "key": "pt",
              "used_key_parts": [
                "product_id"
              ],
              "key_length": "3",
              "ref": [
                "softwarepirmam_hewadelivard_cscart_4.variation_group_products.product_id"
              ],
              "rows_examined_per_scan": 2,
              "rows_produced_per_join": 6,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "1.50",
                "eval_cost": "0.60",
                "prefix_cost": "56.42",
                "data_read_per_join": "96"
              },
              "used_columns": [
                "product_id",
                "category_id"
              ]
            }
          },
          {
            "table": {
              "table_name": "cscart_categories",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY",
                "c_status",
                "p_category_id"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "category_id"
              ],
              "key_length": "3",
              "ref": [
                "softwarepirmam_hewadelivard_cscart_4.products_categories.category_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 0,
              "filtered": "5.00",
              "cost_info": {
                "read_cost": "1.50",
                "eval_cost": "0.03",
                "prefix_cost": "58.52",
                "data_read_per_join": "962"
              },
              "used_columns": [
                "category_id",
                "storefront_id",
                "usergroup_ids",
                "status"
              ],
              "attached_condition": "(((`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`usergroup_ids`))) and (`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`status` in ('A','H')) and (`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`storefront_id` in (0,1)))"
            }
          },
          {
            "table": {
              "table_name": "descr1",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY",
                "product_id"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "product_id",
                "lang_code"
              ],
              "key_length": "9",
              "ref": [
                "softwarepirmam_hewadelivard_cscart_4.variation_group_products.product_id",
                "const"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 0,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "0.04",
                "eval_cost": "0.03",
                "prefix_cost": "58.59",
                "data_read_per_join": "1K"
              },
              "used_columns": [
                "product_id",
                "lang_code",
                "product"
              ]
            }
          }
        ]
      }
    }
  }
}

Result

product_id amount product company_name variation_group_id product_type parent_product_id
11013 100 Ray-Ban Mega Wayfarer 51mm Delivard Store 1053 V 11011
11011 100 Ray-Ban Mega Wayfarer 51mm Delivard Store 1053 P 0
11015 100 Ray-Ban Mega Wayfarer 51mm Delivard Store 1053 V 11011
11014 100 Ray-Ban Mega Wayfarer 51mm Delivard Store 1053 V 11011
11016 100 Ray-Ban Mega Wayfarer 51mm Delivard Store 1053 V 11011
11228 100 Ray-Ban Sam 56mm Delivard Store 1086 P 0
11229 100 Ray-Ban Sam 56mm Delivard Store 1086 V 11228
11330 100 Ray-Ban Hexagonal 54mm Delivard Store 1103 P 0
11331 100 Ray-Ban Hexagonal 54mm Delivard Store 1103 V 11330
11332 100 Ray-Ban Hexagonal 54mm Delivard Store 1103 V 11330
11333 100 Ray-Ban Jack 55mm Delivard Store 1104 P 0
11334 100 Ray-Ban Jack 55mm Delivard Store 1104 V 11333
11335 100 Ray-Ban Jack 55mm Delivard Store 1104 V 11333
11373 100 Ray-Ban Emy Bio-Based 59mm Delivard Store 1122 P 0
11376 100 Ray-Ban Emy Bio-Based 59mm Delivard Store 1122 V 11373
11401 100 Ray-Ban Round Reverse 55mm Delivard Store 1129 P 0
11402 100 Ray-Ban Round Reverse 55mm Delivard Store 1129 V 11401
11403 100 Ray-Ban Round Reverse 55mm Delivard Store 1129 V 11401
11404 100 Ray-Ban Round Reverse 55mm Delivard Store 1129 V 11401
11405 100 Ray-Ban Round Reverse 55mm Delivard Store 1129 V 11401
11432 100 Ray-Ban Emy Bio-Based 56mm Delivard Store 1139 P 0
11433 100 Ray-Ban Emy Bio-Based 56mm Delivard Store 1139 V 11432
11459 100 Ray-Ban Kai Bio-Based 59mm Delivard Store 1146 P 0
11461 100 Ray-Ban Kai Bio-Based 59mm Delivard Store 1146 V 11459
11464 100 Ray-Ban Ari Bio-Based 54mm Delivard Store 1148 P 0
11466 100 Ray-Ban Ari Bio-Based 54mm Delivard Store 1148 V 11464
11468 100 Ray-Ban Ari Bio-Based 54mm Delivard Store 1148 V 11464
11482 100 Ray-Ban Explorer V 57mm Delivard Store 1155 P 0
11483 100 Ray-Ban Explorer V 57mm Delivard Store 1155 V 11482
11484 100 Ray-Ban Explorer V 57mm Delivard Store 1155 V 11482
11485 100 Ray-Ban Explorer V 57mm Delivard Store 1155 V 11482
11486 100 Ray-Ban Explorer V 57mm Delivard Store 1155 V 11482
11496 100 OVAL METAL Delivard Store 1159 P 0
11497 100 OVAL METAL Delivard Store 1159 V 11496
11498 100 OVAL METAL Delivard Store 1159 V 11496
11499 100 OVAL METAL Delivard Store 1159 V 11496
11501 100 Ray-Ban Hexagonal 51mm Delivard Store 1160 P 0
11502 100 Ray-Ban Hexagonal 51mm Delivard Store 1160 V 11501
11503 100 Ray-Ban Hexagonal 51mm Delivard Store 1160 V 11501
11504 100 Ray-Ban Hexagonal 51mm Delivard Store 1160 V 11501
11511 100 Ray-Ban Kai Bio-Based 56mm Delivard Store 1163 P 0
11512 100 Ray-Ban Kai Bio-Based 56mm Delivard Store 1163 V 11511
11513 100 Ray-Ban Kai Bio-Based 56mm Delivard Store 1163 V 11511
11540 100 Ray-Ban Round Reverse 53mm Delivard Store 1173 P 0
11541 100 Ray-Ban Round Reverse 53mm Delivard Store 1173 V 11540
11544 100 Ray-Ban Flacko Bio-Based 56mm Delivard Store 1174 V 11546
11545 100 Ray-Ban Flacko Bio-Based 56mm Delivard Store 1174 V 11546
11546 100 Ray-Ban Flacko Bio-Based 56mm Delivard Store 1174 P 0
11547 100 Ray-Ban Flacko Bio-Based 53mm Delivard Store 1175 P 0
11548 100 Ray-Ban Flacko Bio-Based 53mm Delivard Store 1175 V 11547
11549 100 Ray-Ban RB4441D Bio-Based 53mm Delivard Store 1176 P 0
11554 100 Ray-Ban RB4441D Bio-Based 53mm Delivard Store 1176 V 11549
11556 100 Ray-Ban RB4441D Bio-Based 53mm Delivard Store 1176 V 11549
11557 100 Ray-Ban Explorer V 60mm Delivard Store 1178 P 0
11558 100 Ray-Ban Explorer V 60mm Delivard Store 1178 V 11557
11568 100 Ray-Ban Jack 53mm Delivard Store 1180 P 0
11569 100 Ray-Ban Jack 53mm Delivard Store 1180 V 11568