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 (
    115, 114, 817, 819, 820, 818, 90, 87, 76, 
    98, 102, 89, 92, 94, 85, 66, 63, 62, 54, 
    50, 45, 65
  ) 
  AND products.product_type != 'D' 
GROUP BY 
  products.product_id 
ORDER BY 
  NULL asc

Query time 0.00884

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "131.64"
    },
    "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": 143,
              "rows_produced_per_join": 143,
              "filtered": "100.00",
              "index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`variation_group_products`.`group_id` in (115,114,817,819,820,818,90,87,76,98,102,89,92,94,85,66,63,62,54,50,45,65))",
              "using_join_buffer": "hash join",
              "cost_info": {
                "read_cost": "55.56",
                "eval_cost": "14.30",
                "prefix_cost": "71.42",
                "data_read_per_join": "2K"
              },
              "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": 7,
              "filtered": "5.00",
              "cost_info": {
                "read_cost": "35.75",
                "eval_cost": "0.72",
                "prefix_cost": "121.47",
                "data_read_per_join": "31K"
              },
              "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": 14,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "3.58",
                "eval_cost": "1.43",
                "prefix_cost": "126.48",
                "data_read_per_join": "228"
              },
              "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": "3.58",
                "eval_cost": "0.07",
                "prefix_cost": "131.48",
                "data_read_per_join": "2K"
              },
              "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.09",
                "eval_cost": "0.07",
                "prefix_cost": "131.65",
                "data_read_per_join": "3K"
              },
              "used_columns": [
                "product_id",
                "lang_code",
                "product"
              ]
            }
          }
        ]
      }
    }
  }
}

Result

product_id amount product company_name variation_group_id product_type parent_product_id
908 100 Xiaomi Buds 5 PRO Delivard Store 45 P 0
134 100 Xiaomi Buds 5 PRO Delivard Store 45 V 908
955 500 Apple iPhone 16 Pro Delivard Store 50 V 944
942 500 Apple iPhone 16 Pro Delivard Store 50 V 944
941 500 Apple iPhone 16 Pro Delivard Store 50 V 944
446 500 Apple iPhone 16 Pro Delivard Store 50 V 944
953 500 Apple iPhone 16 Pro Delivard Store 50 V 944
952 500 Apple iPhone 16 Pro Delivard Store 50 V 944
951 500 Apple iPhone 16 Pro Delivard Store 50 V 944
949 500 Apple iPhone 16 Pro Delivard Store 50 V 944
948 500 Apple iPhone 16 Pro Delivard Store 50 V 944
947 500 Apple iPhone 16 Pro Delivard Store 50 V 944
946 500 Apple iPhone 16 Pro Delivard Store 50 V 944
945 500 Apple iPhone 16 Pro Delivard Store 50 V 944
944 500 Apple iPhone 16 Pro Delivard Store 50 P 0
994 100 Apple iPhone 16 Plus Delivard Store 54 V 985
996 100 Apple iPhone 16 Plus Delivard Store 54 V 985
493 100 Apple iPhone 16 Plus Delivard Store 54 V 985
985 100 Apple iPhone 16 Plus Delivard Store 54 P 0
986 100 Apple iPhone 16 Plus Delivard Store 54 V 985
988 100 Apple iPhone 16 Plus Delivard Store 54 V 985
990 100 Apple iPhone 16 Plus Delivard Store 54 V 985
991 100 Apple iPhone 16 Plus Delivard Store 54 V 985
993 100 Apple iPhone 16 Plus Delivard Store 54 V 985
1128 500 Apple Watch SE Delivard Store 62 V 1126
1127 500 Apple Watch SE Delivard Store 62 V 1126
1126 500 Apple Watch SE Delivard Store 62 P 0
1125 500 Apple Watch SE Delivard Store 62 V 1126
1124 500 Apple Watch SE Delivard Store 62 V 1126
1123 500 Apple Watch SE Delivard Store 62 V 1126
1139 500 Apple Watch Series 10 Delivard Store 63 V 1134
1138 500 Apple Watch Series 10 Delivard Store 63 V 1134
1137 500 Apple Watch Series 10 Delivard Store 63 V 1134
1136 500 Apple Watch Series 10 Delivard Store 63 V 1134
1135 500 Apple Watch Series 10 Delivard Store 63 V 1134
1134 500 Apple Watch Series 10 Delivard Store 63 P 0
1133 500 Apple Watch Series 10 Delivard Store 63 V 1134
1132 500 Apple Watch Series 10 Delivard Store 63 V 1134
1131 500 Apple Watch Series 10 Delivard Store 63 V 1134
1130 500 Apple Watch Series 10 Delivard Store 63 V 1134
1129 500 Apple Watch Series 10 Delivard Store 63 V 1134
827 500 Apple Watch Series 10 Delivard Store 63 V 1134
1142 499 Apple AirPods 4 Delivard Store 65 V 853
853 500 Apple AirPods 4 Delivard Store 65 P 0
1146 500 Apple AirPods Max Delivard Store 66 V 1143
1145 500 Apple AirPods Max Delivard Store 66 V 1143
1144 500 Apple AirPods Max Delivard Store 66 V 1143
1143 500 Apple AirPods Max Delivard Store 66 P 0
856 500 Apple AirPods Max Delivard Store 66 V 1143
1322 100 Samsung Galaxy A56 5G Delivard Store 76 V 1319
1262 100 Samsung Galaxy A56 5G Delivard Store 76 V 1319
1317 100 Samsung Galaxy A56 5G Delivard Store 76 V 1319
1318 100 Samsung Galaxy A56 5G Delivard Store 76 V 1319
1319 100 Samsung Galaxy A56 5G Delivard Store 76 P 0
1320 100 Samsung Galaxy A56 5G Delivard Store 76 V 1319
1321 100 Samsung Galaxy A56 5G Delivard Store 76 V 1319
1256 100 Samsung Galaxy A06 Delivard Store 85 P 0
1395 100 Samsung Galaxy A06 Delivard Store 85 V 1256
1396 100 Samsung Galaxy A06 Delivard Store 85 V 1256
1397 100 Samsung Galaxy A06 Delivard Store 85 V 1256
1399 100 Samsung Galaxy A06 Delivard Store 85 V 1256
1406 100 Samsung Galaxy S24 FE Delivard Store 87 P 0
1407 100 Samsung Galaxy S24 FE Delivard Store 87 V 1406
1408 100 Samsung Galaxy S24 FE Delivard Store 87 V 1406
1409 100 Samsung Galaxy S24 FE Delivard Store 87 V 1406
1410 100 Samsung Galaxy S24 FE Delivard Store 87 V 1406
1411 100 Samsung Galaxy S24 FE Delivard Store 87 V 1406
1412 100 Samsung Galaxy S24 FE Delivard Store 87 V 1406
1273 500 Samsung Galaxy Z Fold 6 Delivard Store 89 P 0
1425 100 Samsung Galaxy A55 5G Delivard Store 90 V 1428
1427 100 Samsung Galaxy A55 5G Delivard Store 90 V 1428
1428 99 Samsung Galaxy A55 5G Delivard Store 90 P 0
1429 100 Samsung Galaxy A55 5G Delivard Store 90 V 1428
1431 100 Samsung Galaxy A55 5G Delivard Store 90 V 1428
1266 99 Samsung Galaxy S24 Ultra Delivard Store 92 P 0
1442 500 Samsung Galaxy S24 Ultra Delivard Store 92 V 1266
1447 500 Samsung Galaxy S24 Ultra Delivard Store 92 V 1266
1263 500 Samsung Galaxy S24 Delivard Store 94 P 0
1458 500 Samsung Galaxy S24 Delivard Store 94 V 1263
1284 500 Samsung Galaxy Watch6 Classic Delivard Store 98 P 0
1475 500 Samsung Galaxy Watch6 Classic Delivard Store 98 V 1284
1476 500 Samsung Galaxy Watch6 Classic Delivard Store 98 V 1284
1477 500 Samsung Galaxy Watch6 Classic Delivard Store 98 V 1284
1274 500 Samsung Galaxy Tab A9+ Delivard Store 102 P 0
1483 500 Samsung Galaxy Tab A9+ Delivard Store 102 V 1274
1484 500 Samsung Galaxy Tab A9+ Delivard Store 102 V 1274
1485 500 Samsung Galaxy Tab A9+ Delivard Store 102 V 1274
1486 500 Samsung Galaxy Tab A9+ Delivard Store 102 V 1274
1487 500 Samsung Galaxy Tab A9+ Delivard Store 102 V 1274
1540 100 Samsung Galaxy Buds FE Delivard Store 114 P 0
1541 100 Samsung Galaxy Buds FE Delivard Store 114 V 1540
1542 100 Galaxy Buds 3 Delivard Store 115 P 0
1543 100 Galaxy Buds 3 Delivard Store 115 V 1542
1538 100 Samsung Crystal UHD DU8100 4K Tizen OS Smart TV 65" [2024] Delivard Store 817 P 0
8496 100 Samsung Crystal UHD DU8100 4K Tizen OS Smart TV 55" [2024] Delivard Store 817 P 0
1517 100 Samsung OLED S90D 4K Tizen OS Smart TV 55" [2024] Delivard Store 818 P 0
8498 100 Samsung OLED S90D 4K Tizen OS Smart TV 65" [2024] Delivard Store 818 P 0
8497 100 Samsung OLED S90D 4K Tizen OS Smart TV 77" [2024] Delivard Store 818 P 0
1532 100 Samsung QLED 4K Q60D Tizen OS Smart TV 65" Delivard Store 819 P 0
8502 100 Samsung QLED 4K Q60D Tizen OS Smart TV 75" Delivard Store 819 P 0
8501 100 Samsung QLED 4K Q60D Tizen OS Smart TV 55" Delivard Store 819 P 0
8499 100 Samsung QLED 4K Q60D Tizen OS Smart TV 85" Delivard Store 819 P 0
1528 100 Samsung QLED Q70D Series 4K Smart TV 65" [2024] Delivard Store 820 P 0
8505 100 Samsung QLED Q70D Series 4K Smart TV 75" [2024] Delivard Store 820 P 0
8503 100 Samsung QLED Q70D Series 4K Smart TV 85" [2024] Delivard Store 820 P 0