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, 
  cscart_product_review_prepared_data.average_rating average_rating, 
  cscart_product_review_prepared_data.reviews_count product_reviews_count 
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 
  INNER JOIN cscart_product_variation_group_products AS variation_group_products ON variation_group_products.product_id = products.product_id 
  LEFT JOIN cscart_product_review_prepared_data ON cscart_product_review_prepared_data.product_id = products.product_id 
  AND cscart_product_review_prepared_data.storefront_id = 0 
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 (
    17246, 13678, 12971, 13155, 16321, 13255, 
    13152, 13683, 17017, 16101, 15072, 
    15879, 16065, 13676, 13666, 13765, 
    13443, 13679
  ) 
GROUP BY 
  products.product_id 
ORDER BY 
  NULL asc

Query time 0.09323

JSON explain

{
  "query_block": {
    "select_id": 1,
    "temporary_table": {
      "nested_loop": [
        {
          "table": {
            "table_name": "variation_group_products",
            "access_type": "range",
            "possible_keys": ["PRIMARY", "idx_group_id"],
            "key": "idx_group_id",
            "key_length": "3",
            "used_key_parts": ["group_id"],
            "rows": 86,
            "filtered": 100,
            "index_condition": "variation_group_products.group_id in (17246,13678,12971,13155,16321,13255,13152,13683,17017,16101,15072,15879,16065,13676,13666,13765,13443,13679)"
          }
        },
        {
          "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.variation_group_products.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": "descr1",
            "access_type": "eq_ref",
            "possible_keys": ["PRIMARY", "product_id"],
            "key": "PRIMARY",
            "key_length": "11",
            "used_key_parts": ["product_id", "lang_code"],
            "ref": ["dev_db.variation_group_products.product_id", "const"],
            "rows": 1,
            "filtered": 100,
            "attached_condition": "trigcond(descr1.lang_code = 'en')"
          }
        },
        {
          "table": {
            "table_name": "cscart_product_review_prepared_data",
            "access_type": "eq_ref",
            "possible_keys": ["PRIMARY"],
            "key": "PRIMARY",
            "key_length": "7",
            "used_key_parts": ["product_id", "storefront_id"],
            "ref": ["dev_db.variation_group_products.product_id", "const"],
            "rows": 1,
            "filtered": 100
          }
        },
        {
          "table": {
            "table_name": "products_categories",
            "access_type": "ref",
            "possible_keys": ["PRIMARY", "pt"],
            "key": "pt",
            "key_length": "3",
            "used_key_parts": ["product_id"],
            "ref": ["dev_db.variation_group_products.product_id"],
            "rows": 1,
            "filtered": 100
          }
        },
        {
          "table": {
            "table_name": "cscart_categories",
            "access_type": "eq_ref",
            "possible_keys": ["PRIMARY", "p_category_id"],
            "key": "PRIMARY",
            "key_length": "3",
            "used_key_parts": ["category_id"],
            "ref": ["dev_db.products_categories.category_id"],
            "rows": 1,
            "filtered": 100,
            "using_index": true
          }
        }
      ]
    }
  }
}

Result

product_id amount product company_name variation_group_id product_type parent_product_id average_rating product_reviews_count
18946 999 Scented Candles, Scented Wax And Blue Rose Wax Bouquet Gift Box Onio Soapery 12971 V 3668 5.00 3
18945 998 Scented Candles, Scented Wax And Blue Rose Wax Bouquet Gift Box Onio Soapery 12971 V 3668 5.00 3
18944 999 Scented Candles, Scented Wax And Blue Rose Wax Bouquet Gift Box Onio Soapery 12971 V 3668 5.00 3
3668 999 Scented Candles, Scented Wax And Blue Rose Wax Bouquet Gift Box Onio Soapery 12971 P 0 5.00 3
19588 999 Natural Soy Wax Scented Candle, Sweet Orange Limart - Zero waste 13152 V 3195 5.00 3
3195 999 Natural Soy Wax Scented Candle, Sweet Orange Limart - Zero waste 13152 P 0 5.00 3
19591 999 Natural Soy Wax Scented Candle, Pine Limart - Zero waste 13155 V 3190 0
3190 999 Natural Soy Wax Scented Candle, Pine Limart - Zero waste 13155 P 0 0
20609 997 Round Ceramic Beads Bracelet, Multi Colors I LOVE HANDMADE 13255 V 20598 0
20608 997 Round Ceramic Beads Bracelet, Multi Colors I LOVE HANDMADE 13255 V 20598 0
20607 997 Round Ceramic Beads Bracelet, Multi Colors I LOVE HANDMADE 13255 V 20598 0
20606 997 Round Ceramic Beads Bracelet, Multi Colors I LOVE HANDMADE 13255 V 20598 0
20605 997 Round Ceramic Beads Bracelet, Multi Colors I LOVE HANDMADE 13255 V 20598 0
20604 997 Round Ceramic Beads Bracelet, Multi Colors I LOVE HANDMADE 13255 V 20598 0
20603 997 Round Ceramic Beads Bracelet, Multi Colors I LOVE HANDMADE 13255 V 20598 0
20602 997 Round Ceramic Beads Bracelet, Multi Colors I LOVE HANDMADE 13255 V 20598 0
20601 997 Round Ceramic Beads Bracelet, Multi Colors I LOVE HANDMADE 13255 V 20598 0
20600 997 Round Ceramic Beads Bracelet, Multi Colors I LOVE HANDMADE 13255 V 20598 0
20599 997 Round Ceramic Beads Bracelet, Multi Colors I LOVE HANDMADE 13255 V 20598 0
20598 997 Round Ceramic Beads Bracelet, Multi Colors I LOVE HANDMADE 13255 P 0 0
2946 997 Round Ceramic Beads Bracelet, Multi Colors I LOVE HANDMADE 13255 V 20598 0
21078 6 Witchy House Scented Candle Iris Nguyen - Perfumery House 13443 V 2464 5.00 4
2464 6 Witchy House Scented Candle Iris Nguyen - Perfumery House 13443 P 0 5.00 4
22082 999 Saigon Garden Perfume, Orange-Lemon Fragrance Perfume, Long-Lasting Fragrance, Dynamic And Youthful Aroma Saigon Elixir 13666 V 2009 0
22081 999 Saigon Garden Perfume, Orange-Lemon Fragrance Perfume, Long-Lasting Fragrance, Dynamic And Youthful Aroma Saigon Elixir 13666 V 2009 0
2009 999 Saigon Garden Perfume, Orange-Lemon Fragrance Perfume, Long-Lasting Fragrance, Dynamic And Youthful Aroma Saigon Elixir 13666 P 0 0
22102 999 Lychee Blossom Perfume, Fabric Flower Scent, Feminine Fragrance, Fresh And Youthful Scent, Characteristic Aroma Saigon Elixir 13676 V 1999 0
22101 999 Lychee Blossom Perfume, Fabric Flower Scent, Feminine Fragrance, Fresh And Youthful Scent, Characteristic Aroma Saigon Elixir 13676 V 1999 0
1999 999 Lychee Blossom Perfume, Fabric Flower Scent, Feminine Fragrance, Fresh And Youthful Scent, Characteristic Aroma Saigon Elixir 13676 P 0 0
22106 999 King Wood Perfume, White Sandalwood Perfume, Agarwood Perfume, Warm And Luxurious Scent, Stress-Relieving Saigon Elixir 13678 V 1997 0
22105 999 King Wood Perfume, White Sandalwood Perfume, Agarwood Perfume, Warm And Luxurious Scent, Stress-Relieving Saigon Elixir 13678 V 1997 0
1997 999 King Wood Perfume, White Sandalwood Perfume, Agarwood Perfume, Warm And Luxurious Scent, Stress-Relieving Saigon Elixir 13678 P 0 0
22108 999 Jasmine Absolute Perfume, Handmade Perfume, Jasmine Scent, Sweet And Pleasant Fragrance, Gift For Lovers Saigon Elixir 13679 V 1996 0
22107 999 Jasmine Absolute Perfume, Handmade Perfume, Jasmine Scent, Sweet And Pleasant Fragrance, Gift For Lovers Saigon Elixir 13679 V 1996 0
1996 999 Jasmine Absolute Perfume, Handmade Perfume, Jasmine Scent, Sweet And Pleasant Fragrance, Gift For Lovers Saigon Elixir 13679 P 0 0
22116 998 Gin & Tonic Perfume Saigon Elixir 13683 V 1992 0
22115 998 Gin & Tonic Perfume Saigon Elixir 13683 V 1992 0
1992 998 Gin & Tonic Perfume Saigon Elixir 13683 P 0 0
22471 5 Trapezoid Shaped Cotton Bottle Holder with Floral Patterns, Unique and Versatile Design, Sturdy Product, Gift for a Green Lifestyle TAN Cupholder 13765 V 22466 0
22470 5 Trapezoid Shaped Cotton Bottle Holder with Floral Patterns, Unique and Versatile Design, Sturdy Product, Gift for a Green Lifestyle TAN Cupholder 13765 V 22466 0
22466 5 Trapezoid Shaped Cotton Bottle Holder with Floral Patterns, Unique and Versatile Design, Sturdy Product, Gift for a Green Lifestyle TAN Cupholder 13765 P 0 0
28260 999 Love Gift Box Anni Home 15072 V 28171 0
28258 999 Love Gift Box Anni Home 15072 V 28171 0
28259 999 Love Gift Box Anni Home 15072 V 28171 0
28257 997 Love Gift Box Anni Home 15072 V 28171 0
28171 999 Love Gift Box Anni Home 15072 P 0 0
36758 999 Jelly No.2 Tealight Scented Candle & Holder Gift Set ADORA 15879 P 0 5.00 3
36944 999 Jelly No.2 Tealight Scented Candle & Holder Gift Set ADORA 15879 V 36758 5.00 3
36945 999 Jelly No.2 Tealight Scented Candle & Holder Gift Set ADORA 15879 V 36758 5.00 3
36946 999 Jelly No.2 Tealight Scented Candle & Holder Gift Set ADORA 15879 V 36758 5.00 3
36947 999 Jelly No.2 Tealight Scented Candle & Holder Gift Set ADORA 15879 V 36758 5.00 3
36948 999 Jelly No.2 Tealight Scented Candle & Holder Gift Set ADORA 15879 V 36758 5.00 3
36949 999 Jelly No.2 Tealight Scented Candle & Holder Gift Set ADORA 15879 V 36758 5.00 3
36950 999 Jelly No.2 Tealight Scented Candle & Holder Gift Set ADORA 15879 V 36758 5.00 3
36951 999 Jelly No.2 Tealight Scented Candle & Holder Gift Set ADORA 15879 V 36758 5.00 3
36952 999 Jelly No.2 Tealight Scented Candle & Holder Gift Set ADORA 15879 V 36758 5.00 3
36953 999 Jelly No.2 Tealight Scented Candle & Holder Gift Set ADORA 15879 V 36758 5.00 3
36954 999 Jelly No.2 Tealight Scented Candle & Holder Gift Set ADORA 15879 V 36758 5.00 3
36955 999 Jelly No.2 Tealight Scented Candle & Holder Gift Set ADORA 15879 V 36758 5.00 3
38247 999 Nature-shaped Wooden Hair Pins, Various Designs, Exquisitely Handcrafted, Graceful Curves, Delicate Lines VietArt 16065 V 38102 0
38102 999 Nature-shaped Wooden Hair Pins, Various Designs, Exquisitely Handcrafted, Graceful Curves, Delicate Lines VietArt 16065 P 0 0
38248 999 Nature-shaped Wooden Hair Pins, Various Designs, Exquisitely Handcrafted, Graceful Curves, Delicate Lines VietArt 16065 V 38102 0
38249 999 Nature-shaped Wooden Hair Pins, Various Designs, Exquisitely Handcrafted, Graceful Curves, Delicate Lines VietArt 16065 V 38102 0
38250 999 Nature-shaped Wooden Hair Pins, Various Designs, Exquisitely Handcrafted, Graceful Curves, Delicate Lines VietArt 16065 V 38102 0
38251 999 Nature-shaped Wooden Hair Pins, Various Designs, Exquisitely Handcrafted, Graceful Curves, Delicate Lines VietArt 16065 V 38102 0
38252 999 Nature-shaped Wooden Hair Pins, Various Designs, Exquisitely Handcrafted, Graceful Curves, Delicate Lines VietArt 16065 V 38102 0
38253 999 Nature-shaped Wooden Hair Pins, Various Designs, Exquisitely Handcrafted, Graceful Curves, Delicate Lines VietArt 16065 V 38102 0
38254 999 Nature-shaped Wooden Hair Pins, Various Designs, Exquisitely Handcrafted, Graceful Curves, Delicate Lines VietArt 16065 V 38102 0
38255 999 Nature-shaped Wooden Hair Pins, Various Designs, Exquisitely Handcrafted, Graceful Curves, Delicate Lines VietArt 16065 V 38102 0
38147 999 Thick Thai Brocade Scarf Thổ Cẩm PIÊU - Brocade Decor 16101 P 0 5.00 1
38330 999 Thick Thai Brocade Scarf Thổ Cẩm PIÊU - Brocade Decor 16101 V 38147 5.00 1
40605 999 Glass Diffuser Bottle Flora Collab 16321 V 4191 5.00 3
40606 999 Glass Diffuser Bottle Flora Collab 16321 V 4191 5.00 3
4191 999 Glass Diffuser Bottle Flora Collab 16321 P 0 5.00 3
40611 999 Glass Diffuser Bottle Flora Collab 16321 V 4191 5.00 3
40610 999 Glass Diffuser Bottle Flora Collab 16321 V 4191 5.00 3
40609 999 Glass Diffuser Bottle Flora Collab 16321 V 4191 5.00 3
40608 999 Glass Diffuser Bottle Flora Collab 16321 V 4191 5.00 3
40607 999 Glass Diffuser Bottle Flora Collab 16321 V 4191 5.00 3
47283 999 Washable Paper Passport Cover, Detachable Cover Design, Compact And Convenient, High Durability, Leather Wallet, Personalized Gift KISS Notebook & Gift 17017 V 47274 5.00 3
47282 999 Washable Paper Passport Cover, Detachable Cover Design, Compact And Convenient, High Durability, Leather Wallet, Personalized Gift KISS Notebook & Gift 17017 V 47274 5.00 3
47274 999 Washable Paper Passport Cover, Detachable Cover Design, Compact And Convenient, High Durability, Leather Wallet, Personalized Gift KISS Notebook & Gift 17017 P 0 5.00 3
47281 998 Washable Paper Passport Cover, Detachable Cover Design, Compact And Convenient, High Durability, Leather Wallet, Personalized Gift KISS Notebook & Gift 17017 V 47274 5.00 3
49659 100 Genuine Leather Cardholder, A Modern Masterpiece Of Handcrafted Durability, Compact Design, Convenient And Stylish, Personalized Cardholder, Gift Idea Freewill Leather 17246 V 49186 0
49186 100 Genuine Leather Cardholder, A Modern Masterpiece Of Handcrafted Durability, Compact Design, Convenient And Stylish, Personalized Cardholder, Gift Idea Freewill Leather 17246 P 0 0
49658 100 Genuine Leather Cardholder, A Modern Masterpiece Of Handcrafted Durability, Compact Design, Convenient And Stylish, Personalized Cardholder, Gift Idea Freewill Leather 17246 V 49186 0