SELECT 
  SQL_CALC_FOUND_ROWS products.product_id, 
  descr1.product as product, 
  companies.company as company_name, 
  products.product_type, 
  products.parent_product_id 
FROM 
  cscart_products as products 
  INNER JOIN cscart_product_features_values as c_var ON c_var.product_id = products.product_id 
  AND c_var.lang_code = 'ar' 
  AND c_var.variant_id = 1666 
  LEFT JOIN cscart_product_descriptions as descr1 ON descr1.product_id = products.product_id 
  AND descr1.lang_code = 'ar' 
  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 
  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) 
  LEFT JOIN cscart_product_popularity as popularity ON popularity.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 prices.usergroup_id IN (0, 0, 1) 
  AND products.parent_product_id = 0 
  AND products.product_type != 'D' 
GROUP BY 
  products.product_id 
ORDER BY 
  popularity.total desc, 
  products.product_id ASC 
LIMIT 
  160, 80

Query time 0.04885

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "767.65"
    },
    "ordering_operation": {
      "using_filesort": true,
      "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": "c_var",
              "access_type": "ref",
              "possible_keys": [
                "variant_id",
                "lang_code",
                "product_id",
                "idx_product_feature_variant_id"
              ],
              "key": "variant_id",
              "used_key_parts": [
                "variant_id"
              ],
              "key_length": "3",
              "ref": [
                "const"
              ],
              "rows_examined_per_scan": 1521,
              "rows_produced_per_join": 494,
              "filtered": "32.51",
              "cost_info": {
                "read_cost": "380.25",
                "eval_cost": "49.46",
                "prefix_cost": "533.91",
                "data_read_per_join": "382K"
              },
              "used_columns": [
                "product_id",
                "variant_id",
                "lang_code"
              ],
              "attached_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`c_var`.`lang_code` = 'ar')"
            }
          },
          {
            "table": {
              "table_name": "products",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY",
                "status",
                "idx_parent_product_id"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "product_id"
              ],
              "key_length": "3",
              "ref": [
                "softwarepirmam_hewadelivard_cscart_4.c_var.product_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 24,
              "filtered": "5.00",
              "cost_info": {
                "read_cost": "123.64",
                "eval_cost": "2.47",
                "prefix_cost": "707.01",
                "data_read_per_join": "109K"
              },
              "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`.`parent_product_id` = 0) 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": "prices",
              "access_type": "ref",
              "possible_keys": [
                "usergroup",
                "product_id",
                "lower_limit",
                "usergroup_id"
              ],
              "key": "product_id",
              "used_key_parts": [
                "product_id"
              ],
              "key_length": "3",
              "ref": [
                "softwarepirmam_hewadelivard_cscart_4.c_var.product_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 24,
              "filtered": "99.93",
              "cost_info": {
                "read_cost": "6.18",
                "eval_cost": "2.47",
                "prefix_cost": "715.66",
                "data_read_per_join": "593"
              },
              "used_columns": [
                "product_id",
                "lower_limit",
                "usergroup_id"
              ],
              "attached_condition": "((`softwarepirmam_hewadelivard_cscart_4`.`prices`.`lower_limit` = 1) and (`softwarepirmam_hewadelivard_cscart_4`.`prices`.`usergroup_id` in (0,0,1)))"
            }
          },
          {
            "table": {
              "table_name": "popularity",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY",
                "total"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "product_id"
              ],
              "key_length": "3",
              "ref": [
                "softwarepirmam_hewadelivard_cscart_4.c_var.product_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 24,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "6.18",
                "eval_cost": "2.47",
                "prefix_cost": "724.31",
                "data_read_per_join": "790"
              },
              "used_columns": [
                "product_id",
                "total"
              ]
            }
          },
          {
            "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.c_var.product_id",
                "const"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 24,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "6.28",
                "eval_cost": "2.47",
                "prefix_cost": "733.06",
                "data_read_per_join": "112K"
              },
              "used_columns": [
                "product_id",
                "lang_code",
                "product"
              ]
            }
          },
          {
            "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.c_var.product_id"
              ],
              "rows_examined_per_scan": 2,
              "rows_produced_per_join": 49,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "12.36",
                "eval_cost": "4.94",
                "prefix_cost": "750.35",
                "data_read_per_join": "790"
              },
              "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": 2,
              "filtered": "5.00",
              "cost_info": {
                "read_cost": "12.36",
                "eval_cost": "0.25",
                "prefix_cost": "767.65",
                "data_read_per_join": "7K"
              },
              "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)))"
            }
          }
        ]
      }
    }
  }
}

Result

product_id product company_name product_type parent_product_id
2282 راوتر شاومي مي 4C الأبيض Delivard Store P 0
2285 راوتر شاومي مي 4A جيجابت إديشن Delivard Store P 0
2904 شاومي مي مروحة ذكية قابلة للوقوف 2 Delivard Store P 0
2900 شاومي مكنسة كهربائية بلس G10 (نسخة الاتحاد الأوروبي) Delivard Store P 0
2909 شاومي مي سمارت إير فراير 3.5 لتر Delivard Store P 0
2887 شاومي روبوت مكنسة S20 (نسخة الاتحاد الأوروبي) Delivard Store P 0
2890 شاومي روبوت مكنسة X10 (نسخة الاتحاد الأوروبي) Delivard Store P 0
2888 شاومي روبوت مكنسة E5 (نسخة الاتحاد الأوروبي) Delivard Store P 0
2886 شاومي روبوت مكنسة S20+ (النسخة البريطانية) Delivard Store P 0
8380 شاومي جهاز تنقية الهواء الذكي 4 كومباكت (نسخة الاتحاد الأوروبي) Delivard Store P 0
10237 شاومي مي كاميرا أكشن مع مثبت يدوي Gimbal Delivard Store P 0
7741 Xiaomi Watch 2 Pro Delivard Store P 0
10140 15T شاومي برو Delivard Store P 0
10197 شاومي فلتر جهاز الترطيب التبخيري الذكي Delivard Store P 0
10020 شاومي – حقيبة سفر بإطار من الألمنيوم مقاس ٢٠ بوصة Delivard Store P 0
10299 شاومي ماوس لاسلكي ثنائي الوضع ٢ (أسود) Delivard Store P 0
8379 شاومي مي سمارت مدفأة المساحات S (نسخة الاتحاد الأوروبي) Delivard Store P 0
10167 شاومي حقيبة قابلة لإعادة الاستخدام برتقالية Delivard Store P 0
10344 شاومي ميش سيستم إيه سي١٢٠٠ إي يو (٣ قطع) Delivard Store P 0
10032 شاومي – فلتر جهاز تنقية الهواء الذكي 4 كومباكت برو Delivard Store P 0
10177 شاومي واي فاي رينج إكستاندر إن٣٠٠ Delivard Store P 0
10178 شاومي مونيتور أ٢٤-إي إي يو Delivard Store P 0
10345 شاومي ميش سيستم إيه إكس٣٠٠٠ إن إي إي يو (٣ قطع) Delivard Store P 0
8439 قلم شاومي فوكس Delivard Store P 0
10249 شاومي سمارت باند بندانت فضي Delivard Store P 0
10222 شاومي بوكو F8 برو هاتف ذكي بذاكرة 12 جيجابايت رام وسعة 512 جيجابايت Delivard Store P 0
10035 شاومي – مكنسة كهربائية برو لإزالة عثّ الغبار (نسخة EU) Delivard Store P 0
10147 شاومي بنك طاقة 10,000 مللي أمبير (بكابل مدمج) Delivard Store P 0
10172 شاومي بنك طاقة ١٨ واط ٣٠٠٠٠ مللي أمبير – إصدار عالمي (GL) Delivard Store P 0
10048 شاومي باور بانك ٣٣ واط ٢٠٠٠٠ مللي أمبير Delivard Store P 0
10193 شاومي ستيك تي في الذكي ٤ كيه إي يو Delivard Store P 0
10276 شاومي ريدمي مي واتش 2 لايت Delivard Store P 0
10095 شاومي جهاز عرض ذكي ال ون برو النسخة الأوروبية Delivard Store P 0
10039 شاومي دفاية مكتبية (نسخة الاتحاد الأوروبي) Delivard Store P 0
10228 شاومي 15T هاتف ذكي بذاكرة 12 جيجابايت رام وسعة 512 جيجابايت Delivard Store P 0
10192 شاومي ميش سيستم إيه إكس٣٠٠٠ إن إي (١ قطعة) إي يو Delivard Store P 0
10058 شاومي سوار ساعة جلد أبيض Delivard Store P 0
8345 شاومي مكنسة كهربائية برو 5 اللاسلكية الذكية Delivard Store P 0
10239 شاومي مي عصا سيلفي مع حامل ثلاثي أسود Delivard Store P 0
10148 شاومي ضاغط هواء كهربائي محمول ٢ برو Delivard Store P 0
10156 شاومي ماكينة حلاقة كهربائية إس ٢٠٠ فضي إصدار الاتحاد الأوروبي Delivard Store P 0
10023 شاومي رؤوس بديلة لفرشاة الأسنان الكهربائية T302 Delivard Store P 0
10026 شاومي ماوس لاسلكي إصدار الراحة Delivard Store P 0
10103 كابل شحن مي سمارت باند 4 Delivard Store P 0
10074 شاومي كاميرا خارجية بي دبليو 300 Delivard Store P 0
10088 شاومي كاميرا خارجية ايه دبليو ثلاثمائة النسخة الأوروبية Delivard Store P 0
10174 شاومي حقيبة ظهر للأعمال GL Delivard Store P 0
10233 شاومي بوكو F8 ألترا هاتف ذكي بذاكرة 16 جيجابايت رام وسعة 512 جيجابايت + ساعة ريدمي ووتش 5 لايت هدية Delivard Store P 0
10160 شاومي كابل شحن سمارت باند 7 Delivard Store P 0
10226 شاومي مي غطاء فرشاة مكنسة روبوت Vacuum-MOP P SKV4121TY Delivard Store P 0
10157 شاومي كاميرا خارجية ايه دبليو مائتان Delivard Store P 0
10219 شاومي مي وسادة مسح قابلة للاستخدام مرة واحدة لمكنسة روبوت Vacuum-Mop P Delivard Store P 0
10244 شاومي 6S باد برو بذاكرة 12 جيجابايت رام وسعة 512 جيجابايت Delivard Store P 0
10105 شاومي مي طابعة صور محمولة Delivard Store P 0
10247 شاومي مي كاميرا مراقبة خارجية لاسلكية 1080P مجموعة Delivard Store P 0
10059 شاومي ووتش ٢ هيكل فضي بحزام رمادي Delivard Store P 0
9972 شاومي لوجاج قابل للتمديد أزرق Delivard Store P 0
10274 شاومي ساعة S1 أكتيف GL لون أبيض قمري Delivard Store P 0
10294 شاومي غطاء فرشاة مكنسة روبوت إس ٢٠ Delivard Store P 0
10022 شاومي – سماعات أذن بمنفذ Type-C – أسود Delivard Store P 0
10104 شاومي مي حقيبة سفر معدنية 31 لتر Delivard Store P 0
10261 شاومي مي شريط إضاءة شاشة الكمبيوتر BHR4838GL Delivard Store P 0
9952 شاومي – حقيبة تخزين للسكوتر الكهربائي – أسود Delivard Store P 0
10159 شاومي موسع نطاق واي فاي مي ايه سي ألف ومئتان آر ايه خمسة وسبعون أسود النسخة الأوروبية Delivard Store P 0
10161 شاومي مدفأة برجية ذكية لايت النسخة الأوروبية Delivard Store P 0
10225 شاومي مي فلتر مكنسة روبوت Vacuum-Mop P SKV4120TY Delivard Store P 0
10254 شاومي مي فلتر HEPA لمكنسة يدوية 1C (عدد 2) Delivard Store P 0
10255 شاومي مي فلتر HEPA لمكنسة لايت (عبوة من قطعتين) Delivard Store P 0
10273 شاومي راوتر AX3200 EU Delivard Store P 0
9937 شاومي – حقيبة ظهر كاجوال بغطاء رول توب (GL) – رمادي صخري Delivard Store P 0
9968 شاومي – حقيبة ظهر للتنقّل اليومي – رمادي فاتح Delivard Store P 0
10071 شاومي مدفأة مروحية إصدار الاتحاد الأوروبي Delivard Store P 0
10072 شاومي مكواة بخار يدوية للملابس إصدار الاتحاد الأوروبي Delivard Store P 0
10242 شاومي مي كابل يو إس بي نوع C إلى نوع C بطول 1.5 متر Delivard Store P 0
10272 شاومي مي وسادة المسح لمكنسة الروبوت Vacuum-Mop 1C/2Pro+/2 Delivard Store P 0
9969 شاومي لوجاج كلاسيك أسود Delivard Store P 0
10047 شاومي بنك طاقة ١٠٠٠٠ ملي أمبير ٢٢٫٥ واط لايت جي إل Delivard Store P 0
10050 شاومي روبوت مكنسة إي ٥ وسادة المسح Delivard Store P 0
10056 شاومي خلاط محمول يو إي Delivard Store P 0
10093 شاومي حقيبة تخزين سكوتر كهربائي سعة أربعة لترات Delivard Store P 0