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 (
    812, 819, 563, 815, 567, 820, 640, 813, 
    818, 569, 814, 772, 1097, 765, 817, 767
  ) 
  AND products.product_type != 'D' 
GROUP BY 
  products.product_id 
ORDER BY 
  NULL asc

Query time 0.00370

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "48.26"
    },
    "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": 49,
              "rows_produced_per_join": 49,
              "filtered": "100.00",
              "index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`variation_group_products`.`group_id` in (812,819,563,815,567,820,640,813,818,569,814,772,1097,765,817,767))",
              "using_join_buffer": "hash join",
              "cost_info": {
                "read_cost": "21.16",
                "eval_cost": "4.90",
                "prefix_cost": "27.62",
                "data_read_per_join": "784"
              },
              "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": 2,
              "filtered": "5.00",
              "cost_info": {
                "read_cost": "12.25",
                "eval_cost": "0.25",
                "prefix_cost": "44.77",
                "data_read_per_join": "10K"
              },
              "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": 4,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "1.23",
                "eval_cost": "0.49",
                "prefix_cost": "46.49",
                "data_read_per_join": "78"
              },
              "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.23",
                "eval_cost": "0.02",
                "prefix_cost": "48.20",
                "data_read_per_join": "785"
              },
              "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.03",
                "eval_cost": "0.02",
                "prefix_cost": "48.26",
                "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
4975 100 Nespresso Pixie Machine Delivard Store 563 V 4974
4974 100 Nespresso Pixie Machine Delivard Store 563 P 0
4998 100 Nespresso Essenza Mini D30 Delivard Store 567 V 4995
4995 98 Nespresso Essenza Mini D30 Delivard Store 567 P 0
5039 100 Nespresso Citiz Delivard Store 569 V 4991
5038 100 Nespresso Citiz Delivard Store 569 V 4991
4991 100 Nespresso Citiz Delivard Store 569 P 0
5870 100 Trisa Steam Iron - Comfort Steam Delivard Store 640 V 5661
5661 100 Trisa Steam Iron - Comfort Steam Delivard Store 640 P 0
7608 10 Hisense U7Q Ultra HD 4K Mini-LED Smart TV 75" + ($50 XBOX or PlayStation Gift Card) Delivard Store 765 P 0
7279 10 Hisense U7Q Ultra HD 4K Mini-LED Smart TV 85" + ($50 XBOX or PlayStation Gift Card) Delivard Store 765 P 0
7612 100 Hisense A62QS Series 4K UHD Smart TV 58" Delivard Store 767 P 0
7614 100 Hisense A62QS Series 4K UHD Smart TV 43" Delivard Store 767 P 0
7613 100 Hisense A62QS Series 4K UHD Smart TV 55" Delivard Store 767 P 0
7248 100 Hisense A62QS Series 4K UHD Smart TV 65" Delivard Store 767 P 0
7624 100 Hisense A61N Smart LED TV 70" Delivard Store 772 P 0
7277 100 Hisense A61N Smart LED TV 50" Delivard Store 772 P 0
7623 100 Hisense A61N Smart LED TV 75" Delivard Store 772 P 0
2432 100 Xiaomi TV A Pro 2026 75" Delivard Store 812 P 0
8485 100 Xiaomi TV A Pro 2026 65" Delivard Store 812 P 0
8484 100 Xiaomi TV A Pro 2026 55" Delivard Store 812 P 0
8483 100 Xiaomi TV A Pro 2026 43" Delivard Store 812 P 0
2455 100 Xiaomi TV A Pro 2025 75" Delivard Store 813 P 0
8488 100 Xiaomi TV A Pro 2025 65" Delivard Store 813 P 0
8487 100 Xiaomi TV A Pro 2025 55" Delivard Store 813 P 0
8486 100 Xiaomi TV A Pro 2025 43" Delivard Store 813 P 0
8490 100 Xiaomi TV A 2026 65" Delivard Store 814 P 0
8489 100 Xiaomi TV A 2026 55" Delivard Store 814 P 0
2438 100 Xiaomi TV A 2026 50" Delivard Store 814 P 0
2459 100 Xiaomi TV A 2025 65" Delivard Store 815 P 0
8492 100 Xiaomi TV A 2025 50" Delivard Store 815 P 0
8491 100 Xiaomi TV A 2025 43" Delivard Store 815 P 0
8493 100 Xiaomi TV A 2025 55" Delivard Store 815 P 0
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
5346 100 DE’LONGHI MAGNIFICA S Delivard Store 1097 P 0