SELECT 
  SQL_CALC_FOUND_ROWS products.product_id, 
  descr1.product as product, 
  companies.company as company_name, 
  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_product_prices as prices ON prices.product_id = products.product_id 
  AND prices.lower_limit = 1 
  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 
  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 
  LEFT JOIN cscart_product_popularity as popularity ON popularity.product_id = products.product_id 
WHERE 
  1 
  AND cscart_categories.category_id IN (
    110, 209, 210, 211, 212, 213, 315, 321, 
    323
  ) 
  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 prices.usergroup_id IN (0, 0, 1) 
  AND products.parent_product_id = 0 
GROUP BY 
  products.product_id 
ORDER BY 
  popularity.total desc, 
  products.product_id ASC 
LIMIT 
  32, 32

Query time 0.29487

JSON explain

{
  "query_block": {
    "select_id": 1,
    "filesort": {
      "sort_key": "popularity.total desc, products.product_id",
      "temporary_table": {
        "nested_loop": [
          {
            "table": {
              "table_name": "cscart_categories",
              "access_type": "range",
              "possible_keys": ["PRIMARY", "p_category_id"],
              "key": "PRIMARY",
              "key_length": "3",
              "used_key_parts": ["category_id"],
              "rows": 9,
              "filtered": 100,
              "attached_condition": "cscart_categories.category_id in (110,209,210,211,212,213,315,321,323)",
              "using_index": true
            }
          },
          {
            "table": {
              "table_name": "products_categories",
              "access_type": "ref",
              "possible_keys": ["PRIMARY", "pt"],
              "key": "PRIMARY",
              "key_length": "3",
              "used_key_parts": ["category_id"],
              "ref": ["dev_db.cscart_categories.category_id"],
              "rows": 359,
              "filtered": 100,
              "using_index": true
            }
          },
          {
            "table": {
              "table_name": "products",
              "access_type": "eq_ref",
              "possible_keys": ["PRIMARY", "status", "idx_parent_product_id"],
              "key": "PRIMARY",
              "key_length": "3",
              "used_key_parts": ["product_id"],
              "ref": ["dev_db.products_categories.product_id"],
              "rows": 1,
              "filtered": 18.48341942,
              "attached_condition": "products.parent_product_id = 0 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` = '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.products_categories.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.products_categories.product_id", "const"],
              "rows": 1,
              "filtered": 100
            }
          },
          {
            "table": {
              "table_name": "popularity",
              "access_type": "eq_ref",
              "possible_keys": ["PRIMARY", "total"],
              "key": "PRIMARY",
              "key_length": "3",
              "used_key_parts": ["product_id"],
              "ref": ["dev_db.products_categories.product_id"],
              "rows": 1,
              "filtered": 100
            }
          },
          {
            "table": {
              "table_name": "prices",
              "access_type": "ref",
              "possible_keys": [
                "usergroup",
                "product_id",
                "lower_limit",
                "usergroup_id"
              ],
              "key": "product_id",
              "key_length": "3",
              "used_key_parts": ["product_id"],
              "ref": ["dev_db.products_categories.product_id"],
              "rows": 1,
              "filtered": 99.9960556,
              "attached_condition": "prices.lower_limit = 1 and prices.usergroup_id in (0,0,1)"
            }
          }
        ]
      }
    }
  }
}

Result

product_id product company_name product_type parent_product_id average_rating product_reviews_count
35279 Personalized Laser Engraved Tumbler, 500Ml, More Than Just A Mug, Express Your Individuality, Unique Gift, Personalized Gifts Chu Du Bag P 0 5.00 28
25318 Hexagonal Wooden Frame with Bride and Groom Dolls, Gifts of Natural Fabric And Wool, Meaningful Gifts, Gifts For Couple, Unique Design, Personalized Gift Sewing Art Decor Studio P 0 5.00 14
47597 Handmade Paper Flower Painting - Lotus With Calligraphy MAYPAPERFLOWER 25x25cm Wooden Frame, Interior Decoration, Handmade Gifts, Personalized Gifts Maypaperflower P 0 5.00 15
47084 Name Engraving Leather Keychain, Premium Leather Material, Engravable, Personalized Touch, Rustic Style I AM Leather P 0 5.00 14
5787 Box Of 6 Chocolate Mendiant, Handmade Chocolate, Chocolate With Nuts, Chocolate With Dried Fruit, Unique Chocolate Gift, High-Quality Dark Chocolate PPG Handmade Chocolate P 0 4.84 56
1767 Bamboo Pens With Customized Logo, Exquisite Craftsmanship, Skilled Artisans, Natural Bamboo Material, Customizable Product Nhà An Lành P 0 5.00 7
18608 50 x 70cm Satin Silk Pillowcase With Bow Ties, Soft and Breathable Material, Meticulously Sewn Seams, High-Quality Pillow Cover Goûttobed P 0 5.00 18
1057 Genuine Leather Passport Cover, Genuine Leather, Genuine Leather Accessories, Wallet with Name Card, Handmade Gift, Personalized Gift Tamy Beloved P 0 5.00 7
5790 LUV CHOC-A LOT Handmade Chocolate Gift Box, Handmade Chocolate Gift, Chocolate Bark, Chocolate Covered Almonds, Scented Wax Rose, Anniversaries Gift PPG Handmade Chocolate P 0 4.54 24
33723 Colored & Engraved Mini Wallet With Zipper, Custom Engraving Available, Fashion Accessory, Unique And Eye-Catching Design Tamuha Handcraft P 0 5.00 17
2803 Bio Hair Care Set DONA LAB P 0 5.00 2
17265 Paper Gift Box with A Herbal Tea Jar, Variety Pack, Relaxation Tea, Sleep-Aiding Tea, Tea Gift Box, Gift for Her, Family Gift, Healthy Gift Là Nhiên P 0 4.79 28
47655 Moc Truly Hue’s 2024 “Phap Lam” Gift Box, Gift From Ancient Town, Hue Specialty, Vietnamese Traditional Food Gift, Artistic Hand-painted Gift Box Mộc Truly Huế P 0 5.00 15
5789 A KISS FOR HER Handmade Chocolate Gift Box, Vietnam Chocolate Gift, Passionate Kiss Chocolate Gift, Romantic Gift, High-Quality Chocolate PPG Handmade Chocolate P 0 4.95 19
47922 Vietnamese Bean Dessert Cart Magnet, Miniature Vietnamese Street Food Cart, Handmade Vietnamese Souvenirs, Unique Vietnamese Gift The 90's DIY P 0 5.00 24
47921 Sugarcane Juice Cart Magnet, Vietnamese Handicraft Magnet, Saigon Street Food Magnet, Vietnam Souvenir, Artistic Fridge Magnet, Unique Vietnamese Gift The 90's DIY P 0 4.94 16
47896 Broken Rice Cart Magnet, Vietnamese Street Food Magnet, Saigon Souvenir, Vietnamese Handicraft, Unique Vietnamese Gift, Saigon Street Food The 90's DIY P 0 5.00 22
47924 Sweet Sticky Rice Cart Magnet, Vietnamese Street Food Magnet, Saigon Street Vendor Magnet, Vietnamese Souvenirs, Unique Vietnamese Gift The 90's DIY P 0 4.92 12
47923 Vietnamese Hollow Donut Cart Magnet, Vietnamese Street Food Magnet, Vietnamese Souvenir Magnet, Handcrafted Vietnamese Decor, Unique Vietnamese Gift The 90's DIY P 0 4.86 7
33312 Mộc Truly Huế Gift Box, Set 2, Specialty Gift Set, Vietnamese Gift, Lotus Flower Tea, Thanh Tra Preserves, Hue Ginger Preserves, Phu Linh Cake Mộc Truly Huế P 0 5.00 19
3287 Seasonal-Spice Set With Wooden Box, Kitchen Spice Gift Box, Organic Spices, Premium Spices, Organic Food, Family Gift Set The Hồ Tiêu P 0 5.00 2
3286 Peppercorn Wooden Gift Box, 6 Types Of Pepper With Pepper Mill, Set Of 6 Gifts, Set Of 6 Types Of Pepper, Fragrant And Spicy Forest Pepper The Hồ Tiêu P 0 5.00 12
3872 Lacquered Buffalo, Vietnamese Elements, Beautiful Feng Shui Decor, Interior Decoration, Feng Shui Gift HCERAMIC P 0 5.00 17
5300 Paper Gift Box with 3 Large Herbal Tea Blend Jars, High-Quality Blend, Vietnamese Herbs, Clean Ingredients, Health Gift, Meaningful Gift Là Nhiên P 0 4.70 30
5297 Paper Gift Box with 3 Large Herbal Tea Jars, Natural Tea, Relaxation Tea, Vietnamese Clean Ingredients, Healthy Gift, Family Gift Là Nhiên P 0 4.74 31
1579 Hue Lotus Tea, Herbal Tea, Floral Tea, Vietnamese Specialty, Handpicked, Organic Tea, Gift Idea, Unique Vietnam Gift Mộc Truly Huế P 0 5.00 22
65 Peppercorn Gift Set, Whole Clean Pepper, Set Of 6 Jars Of Pepper, Fragrant Pepper, Long-Lasting Flavor, Organic Clean Pepper The Hồ Tiêu P 0 5.00 4
1587 Sesame Candies, Specialty of Hue, Vietnamese Treats, Gift for Foreigners, Vietnamese Gift, Handcrafted Sweets Mộc Truly Huế P 0 4.93 30
47024 "Water Lilies" Metal Cuff Bracelet, Leather Bracelet Arts Collection, Hand-painted Leather Cuff Bracelet, Monet Inspired Bracelet, Gift For Art Lovers ĐỎ P 0 5.00 21
1102 Vietnamese Lotus Tea, Organic Tea, Harvested By Hand, Organic Farming, Local Sources, Vietnamese Tea, Healthy Drinks, Gifts For Health SACHSTEA 1773 P 0 4.71 21
41293 "Thi" Metal Cuff Bracelet with Hand-painted Leather, Four Arts Collection, Stainless Steel Cuff Bracelet, Vietnamese Design, Artistic Gift ĐỎ P 0 4.58 19
17259 Paper Gift Box with A Herbal Tea Blend Jar, Relaxation Tea, Sleep Aid Tea, Sleep Support Tea, Detox Tea, Meaningful Gift Set, Health Gift Là Nhiên P 0 4.71 31