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 (
    13157, 15596, 13434, 12288, 13156, 13054, 
    14395, 16536, 13158, 14672, 13419, 
    15828, 14018, 12475, 12589, 16999, 
    17365
  ) 
GROUP BY 
  products.product_id 
ORDER BY 
  NULL asc

Query time 0.05479

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": 90,
            "filtered": 100,
            "index_condition": "variation_group_products.group_id in (13157,15596,13434,12288,13156,13054,14395,16536,13158,14672,13419,15828,14018,12475,12589,16999,17365)"
          }
        },
        {
          "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
15451 997 Nourishing Herbal Handmade Soap, Helps Detoxify the Skin, Nourishes Healthy Skin, Antibacterial Properties, Natural Ingredients Lecteur De Craft 12288 V 6197 5.00 2
15450 997 Nourishing Herbal Handmade Soap, Helps Detoxify the Skin, Nourishes Healthy Skin, Antibacterial Properties, Natural Ingredients Lecteur De Craft 12288 V 6197 5.00 2
6197 987 Nourishing Herbal Handmade Soap, Helps Detoxify the Skin, Nourishes Healthy Skin, Antibacterial Properties, Natural Ingredients Lecteur De Craft 12288 P 0 5.00 2
16505 999 Peppermint Soap, Effectively Cleanses, Fresh and Refreshing Scent, Gentle on the Skin, Natural Ingredients, Non-Irritating RỊ MỌ HOUSE 12475 V 5656 5.00 2
5656 999 Peppermint Soap, Effectively Cleanses, Fresh and Refreshing Scent, Gentle on the Skin, Natural Ingredients, Non-Irritating RỊ MỌ HOUSE 12475 P 0 5.00 2
17730 999 Fog Scented Candle OnaTree - Vietnamese Cosmetics 12589 V 5146 5.00 1
17729 999 Fog Scented Candle OnaTree - Vietnamese Cosmetics 12589 V 5146 5.00 1
5146 998 Fog Scented Candle OnaTree - Vietnamese Cosmetics 12589 P 0 5.00 1
19311 999 Agarwood Incense Burner, Exquisite Design, Beautiful Smoke Emission, Solid Wood, Elegant and Peaceful Accent, Provides a Sense of Serenity Nico studio 13054 V 3465 5.00 2
3465 999 Agarwood Incense Burner, Exquisite Design, Beautiful Smoke Emission, Solid Wood, Elegant and Peaceful Accent, Provides a Sense of Serenity Nico studio 13054 P 0 5.00 2
19592 999 Natural Soy Wax Scented Candle, Cedarwood Limart - Zero waste 13156 V 3189 5.00 1
3189 999 Natural Soy Wax Scented Candle, Cedarwood Limart - Zero waste 13156 P 0 5.00 1
19599 999 Decorative Hand-drawn Wooden Pieces, Customizable Artwork, Cute Decorative Accessories, Minimalist Design, Handmade Product Limart - Zero waste 13157 V 3187 5.00 2
19598 999 Decorative Hand-drawn Wooden Pieces, Customizable Artwork, Cute Decorative Accessories, Minimalist Design, Handmade Product Limart - Zero waste 13157 V 3187 5.00 2
19597 999 Decorative Hand-drawn Wooden Pieces, Customizable Artwork, Cute Decorative Accessories, Minimalist Design, Handmade Product Limart - Zero waste 13157 V 3187 5.00 2
19596 999 Decorative Hand-drawn Wooden Pieces, Customizable Artwork, Cute Decorative Accessories, Minimalist Design, Handmade Product Limart - Zero waste 13157 V 3187 5.00 2
19595 999 Decorative Hand-drawn Wooden Pieces, Customizable Artwork, Cute Decorative Accessories, Minimalist Design, Handmade Product Limart - Zero waste 13157 V 3187 5.00 2
19594 999 Decorative Hand-drawn Wooden Pieces, Customizable Artwork, Cute Decorative Accessories, Minimalist Design, Handmade Product Limart - Zero waste 13157 V 3187 5.00 2
19593 999 Decorative Hand-drawn Wooden Pieces, Customizable Artwork, Cute Decorative Accessories, Minimalist Design, Handmade Product Limart - Zero waste 13157 V 3187 5.00 2
3187 999 Decorative Hand-drawn Wooden Pieces, Customizable Artwork, Cute Decorative Accessories, Minimalist Design, Handmade Product Limart - Zero waste 13157 P 0 5.00 2
19600 998 Natural Soy Wax Sachet Limart - Zero waste 13158 V 3186 5.00 1
3186 999 Natural Soy Wax Sachet Limart - Zero waste 13158 P 0 5.00 1
21046 999 Unscented Marble Taper Candle Calla Floral 13419 V 2499 4.00 1
21045 999 Unscented Marble Taper Candle Calla Floral 13419 V 2499 4.00 1
21044 999 Unscented Marble Taper Candle Calla Floral 13419 V 2499 4.00 1
21043 999 Unscented Marble Taper Candle Calla Floral 13419 V 2499 4.00 1
2499 999 Unscented Marble Taper Candle Calla Floral 13419 P 0 4.00 1
21069 4 Ease Goodnight Spray, Soothing Essential Oils, Supports Deeper Sleep, High Scent Retention, Gentle Fragrance, Natural Product Iris Nguyen - Perfumery House 13434 V 2473 5.00 1
2473 4 Ease Goodnight Spray, Soothing Essential Oils, Supports Deeper Sleep, High Scent Retention, Gentle Fragrance, Natural Product Iris Nguyen - Perfumery House 13434 P 0 5.00 1
1375 1004 Eco-friendly Rattan Basket, Various Size Options, With Lining and Lid, Classic Style, Handcrafted Product THE GREENMART VIETNAM 14018 P 0 5.00 2
23354 1004 Eco-friendly Rattan Basket, Various Size Options, With Lining and Lid, Classic Style, Handcrafted Product THE GREENMART VIETNAM 14018 V 1375 5.00 2
23355 1004 Eco-friendly Rattan Basket, Various Size Options, With Lining and Lid, Classic Style, Handcrafted Product THE GREENMART VIETNAM 14018 V 1375 5.00 2
735 4 Brocade Coaster, Rustic Patterns, Absorbent Fabric Material, Naturally Dyed Colors, Simple Design, Handcrafted Product Thổ Cẩm PIÊU - Brocade Decor 14395 P 0 0
26099 1998 Feng Shui Crystal Macrame Necklace, Attracts Positive Energy, Suitable for Various Zodiac Signs, Feng Shui Product Crystals Macrame 14672 V 298 5.00 1
298 1997 Feng Shui Crystal Macrame Necklace, Attracts Positive Energy, Suitable for Various Zodiac Signs, Feng Shui Product Crystals Macrame 14672 P 0 5.00 1
33606 999 A Family Of Dog Ceramic Figurine Set HCERAMIC 15596 P 0 5.00 5
33620 999 A Family Of Dog Ceramic Figurine Set HCERAMIC 15596 V 33606 5.00 5
33621 999 A Family Of Dog Ceramic Figurine Set HCERAMIC 15596 V 33606 5.00 5
33622 999 A Family Of Dog Ceramic Figurine Set HCERAMIC 15596 V 33606 5.00 5
33623 999 A Family Of Dog Ceramic Figurine Set HCERAMIC 15596 V 33606 5.00 5
33624 999 A Family Of Dog Ceramic Figurine Set HCERAMIC 15596 V 33606 5.00 5
33625 999 A Family Of Dog Ceramic Figurine Set HCERAMIC 15596 V 33606 5.00 5
33626 999 A Family Of Dog Ceramic Figurine Set HCERAMIC 15596 V 33606 5.00 5
33627 999 A Family Of Dog Ceramic Figurine Set HCERAMIC 15596 V 33606 5.00 5
33628 999 A Family Of Dog Ceramic Figurine Set HCERAMIC 15596 V 33606 5.00 5
33629 999 A Family Of Dog Ceramic Figurine Set HCERAMIC 15596 V 33606 5.00 5
33630 999 A Family Of Dog Ceramic Figurine Set HCERAMIC 15596 V 33606 5.00 5
33631 999 A Family Of Dog Ceramic Figurine Set HCERAMIC 15596 V 33606 5.00 5
33632 999 A Family Of Dog Ceramic Figurine Set HCERAMIC 15596 V 33606 5.00 5
33633 999 A Family Of Dog Ceramic Figurine Set HCERAMIC 15596 V 33606 5.00 5
36574 20 Daisies At Home Decorative Art Print, Size A3 / A4, Included Frame, Harmonious Colors, Simple and Elegant Design, Artistic Accent Nhu Pham Art 15828 P 0 5.00 2
36506 20 Daisies At Home Decorative Art Print, Size A3 / A4, Included Frame, Harmonious Colors, Simple and Elegant Design, Artistic Accent Nhu Pham Art 15828 V 36574 5.00 2
42023 999 Horoscope Theme, Cylinder Dried Flowers Scented Candle Onio Soapery 16536 V 41945 5.00 1
42022 999 Horoscope Theme, Cylinder Dried Flowers Scented Candle Onio Soapery 16536 V 41945 5.00 1
42021 999 Horoscope Theme, Cylinder Dried Flowers Scented Candle Onio Soapery 16536 V 41945 5.00 1
42020 999 Horoscope Theme, Cylinder Dried Flowers Scented Candle Onio Soapery 16536 V 41945 5.00 1
42019 999 Horoscope Theme, Cylinder Dried Flowers Scented Candle Onio Soapery 16536 V 41945 5.00 1
42018 999 Horoscope Theme, Cylinder Dried Flowers Scented Candle Onio Soapery 16536 V 41945 5.00 1
42017 999 Horoscope Theme, Cylinder Dried Flowers Scented Candle Onio Soapery 16536 V 41945 5.00 1
42016 999 Horoscope Theme, Cylinder Dried Flowers Scented Candle Onio Soapery 16536 V 41945 5.00 1
42015 999 Horoscope Theme, Cylinder Dried Flowers Scented Candle Onio Soapery 16536 V 41945 5.00 1
42014 999 Horoscope Theme, Cylinder Dried Flowers Scented Candle Onio Soapery 16536 V 41945 5.00 1
42013 999 Horoscope Theme, Cylinder Dried Flowers Scented Candle Onio Soapery 16536 V 41945 5.00 1
41945 999 Horoscope Theme, Cylinder Dried Flowers Scented Candle Onio Soapery 16536 P 0 5.00 1
47127 999 Personalized Snow Ball Leather Ornament, Christmas Decoration, Festive Decor Accessory, Perfect Christmas Gift For Friends And Family, Personalized Gifts I AM Leather 16999 V 47082 5.00 6
47126 999 Personalized Snow Ball Leather Ornament, Christmas Decoration, Festive Decor Accessory, Perfect Christmas Gift For Friends And Family, Personalized Gifts I AM Leather 16999 V 47082 5.00 6
47082 999 Personalized Snow Ball Leather Ornament, Christmas Decoration, Festive Decor Accessory, Perfect Christmas Gift For Friends And Family, Personalized Gifts I AM Leather 16999 P 0 5.00 6
50407 999 Zodiac Glass Scented Candle, Zodiac Candles, Scented Candle Gifts, Handcrafted Candles, Home Decor, Gift Ideas, Unique Birthday Gifts Onio Soapery 17365 V 50395 5.00 10
50409 999 Zodiac Glass Scented Candle, Zodiac Candles, Scented Candle Gifts, Handcrafted Candles, Home Decor, Gift Ideas, Unique Birthday Gifts Onio Soapery 17365 V 50395 5.00 10
50408 999 Zodiac Glass Scented Candle, Zodiac Candles, Scented Candle Gifts, Handcrafted Candles, Home Decor, Gift Ideas, Unique Birthday Gifts Onio Soapery 17365 V 50395 5.00 10
50406 999 Zodiac Glass Scented Candle, Zodiac Candles, Scented Candle Gifts, Handcrafted Candles, Home Decor, Gift Ideas, Unique Birthday Gifts Onio Soapery 17365 V 50395 5.00 10
50404 999 Zodiac Glass Scented Candle, Zodiac Candles, Scented Candle Gifts, Handcrafted Candles, Home Decor, Gift Ideas, Unique Birthday Gifts Onio Soapery 17365 V 50395 5.00 10
50395 999 Zodiac Glass Scented Candle, Zodiac Candles, Scented Candle Gifts, Handcrafted Candles, Home Decor, Gift Ideas, Unique Birthday Gifts Onio Soapery 17365 P 0 5.00 10
50403 999 Zodiac Glass Scented Candle, Zodiac Candles, Scented Candle Gifts, Handcrafted Candles, Home Decor, Gift Ideas, Unique Birthday Gifts Onio Soapery 17365 V 50395 5.00 10
50405 999 Zodiac Glass Scented Candle, Zodiac Candles, Scented Candle Gifts, Handcrafted Candles, Home Decor, Gift Ideas, Unique Birthday Gifts Onio Soapery 17365 V 50395 5.00 10
50413 999 Zodiac Glass Scented Candle, Zodiac Candles, Scented Candle Gifts, Handcrafted Candles, Home Decor, Gift Ideas, Unique Birthday Gifts Onio Soapery 17365 V 50395 5.00 10
50412 999 Zodiac Glass Scented Candle, Zodiac Candles, Scented Candle Gifts, Handcrafted Candles, Home Decor, Gift Ideas, Unique Birthday Gifts Onio Soapery 17365 V 50395 5.00 10
50411 999 Zodiac Glass Scented Candle, Zodiac Candles, Scented Candle Gifts, Handcrafted Candles, Home Decor, Gift Ideas, Unique Birthday Gifts Onio Soapery 17365 V 50395 5.00 10
50410 999 Zodiac Glass Scented Candle, Zodiac Candles, Scented Candle Gifts, Handcrafted Candles, Home Decor, Gift Ideas, Unique Birthday Gifts Onio Soapery 17365 V 50395 5.00 10