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 = 'ar' 
  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 (
    829, 847, 824, 826, 828, 836, 825, 845, 
    851, 865, 858, 843, 859, 827, 834, 863, 
    830, 846
  ) 
  AND products.product_type != 'D' 
GROUP BY 
  products.product_id 
ORDER BY 
  NULL asc

Query time 0.00326

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "65.31"
    },
    "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": 68,
              "rows_produced_per_join": 68,
              "filtered": "100.00",
              "index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`variation_group_products`.`group_id` in (829,847,824,826,828,836,825,845,851,865,858,843,859,827,834,863,830,846))",
              "using_join_buffer": "hash join",
              "cost_info": {
                "read_cost": "28.31",
                "eval_cost": "6.80",
                "prefix_cost": "36.67",
                "data_read_per_join": "1K"
              },
              "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": 3,
              "filtered": "5.00",
              "cost_info": {
                "read_cost": "17.00",
                "eval_cost": "0.34",
                "prefix_cost": "60.47",
                "data_read_per_join": "15K"
              },
              "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": 6,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "1.70",
                "eval_cost": "0.68",
                "prefix_cost": "62.85",
                "data_read_per_join": "108"
              },
              "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.70",
                "eval_cost": "0.03",
                "prefix_cost": "65.23",
                "data_read_per_join": "1K"
              },
              "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.04",
                "eval_cost": "0.03",
                "prefix_cost": "65.31",
                "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
8562 100 تومتوك حقيبة ظهر لابتوب 15.6 إنش / 22 لتر Delivard Store 824 P 0
8563 100 تومتوك حقيبة ظهر لابتوب 15.6 إنش / 22 لتر Delivard Store 824 V 8562
8564 100 تومتوك حقيبة ظهر لابتوب 15.6 إنش / 22 لتر Delivard Store 824 V 8562
8565 100 تومتوك حقيبة ظهر لابتوب 15.6 إنش / 22 لتر Delivard Store 824 V 8562
8619 100 تومتوك حافظة لابتوب A13 Delivard Store 825 P 0
8621 100 تومتوك حافظة لابتوب A13 Delivard Store 825 V 8619
8622 100 تومتوك حافظة لابتوب A13 Delivard Store 825 V 8619
8623 100 تومتوك حافظة لابتوب A13 Delivard Store 825 V 8619
8624 100 تومتوك حافظة لابتوب A13 Delivard Store 825 V 8619
8625 100 تومتوك حافظة لابتوب A13 Delivard Store 825 V 8619
8918 100 تومتوك حافظة لابتوب A13 Delivard Store 825 V 8619
8919 100 تومتوك حافظة لابتوب A13 Delivard Store 825 V 8619
8920 100 تومتوك حافظة لابتوب A13 Delivard Store 825 V 8619
8627 100 تومتوك حقيبة لابتوب A14 Delivard Store 826 P 0
8631 100 تومتوك حقيبة لابتوب A14 Delivard Store 826 V 8627
8632 100 تومتوك حقيبة لابتوب A14 Delivard Store 826 V 8627
8633 100 تومتوك حقيبة لابتوب A14 Delivard Store 826 V 8627
8692 100 تومتوك حقيبة لابتوب A14 Delivard Store 826 V 8627
8655 100 تومتوك حافظة لابتوب A18 Delivard Store 827 P 0
8656 100 تومتوك حافظة لابتوب A18 Delivard Store 827 V 8655
8657 100 تومتوك حقيبة لابتوب A21 ‏13.5 بوصة Delivard Store 828 P 0
8658 100 تومتوك حقيبة لابتوب A21 ‏13.5 بوصة Delivard Store 828 V 8657
8659 100 تومتوك حقيبة لابتوب A21 ‏13.5 بوصة Delivard Store 828 V 8657
8660 100 تومتوك حقيبة لابتوب A21 ‏13.5 بوصة Delivard Store 828 V 8657
8663 100 تومتوك حقيبة إكسسوارات A27 سعة 2 لتر Delivard Store 829 P 0
8664 100 تومتوك حقيبة إكسسوارات A27 سعة 2 لتر Delivard Store 829 V 8663
8665 100 تومتوك حقيبة إكسسوارات A27 سعة 2 لتر Delivard Store 829 V 8663
8666 100 تومتوك حقيبة إكسسوارات A27 سعة 2 لتر Delivard Store 829 V 8663
8667 100 تومتوك حقيبة لابتوب A42 ‏15.6 بوصة Delivard Store 830 P 0
8668 100 تومتوك حقيبة لابتوب A42 ‏15.6 بوصة Delivard Store 830 V 8667
8935 100 تومتوك حقيبة لابتوب A42 ‏15.6 بوصة Delivard Store 830 V 8667
8568 100 تومتوك حافظة لابتوب A10 Delivard Store 834 P 0
8685 100 تومتوك حافظة لابتوب A10 Delivard Store 834 V 8568
8689 100 تومتوك حقيبة لابتوب يد A12 مقاس 13.5 بوصة Delivard Store 836 P 0
8690 100 تومتوك حقيبة لابتوب يد A12 مقاس 13.5 بوصة Delivard Store 836 V 8689
8691 100 تومتوك حقيبة لابتوب يد A12 مقاس 13.5 بوصة Delivard Store 836 V 8689
8731 100 تومتوك حافظة لابتوب A27 Delivard Store 843 P 0
8733 100 تومتوك حافظة لابتوب A27 Delivard Store 843 V 8731
8732 100 تومتوك حافظة لابتوب A27 Delivard Store 843 V 8731
8734 100 تومتوك حافظة لابتوب A27 Delivard Store 843 V 8731
8735 100 تومتوك حافظة لابتوب A27 Delivard Store 843 V 8731
8736 100 تومتوك حافظة لابتوب A27 Delivard Store 843 V 8731
8760 100 Hama Silvan Laptop Bag Sustainable Delivard Store 845 V 8766
8763 100 Hama Silvan Laptop Bag Sustainable Delivard Store 845 V 8766
8764 100 Hama Silvan Laptop Bag Sustainable Delivard Store 845 V 8766
8765 100 Hama Silvan Laptop Bag Sustainable Delivard Store 845 V 8766
8766 100 Hama Silvan Laptop Bag Sustainable Delivard Store 845 P 0
8776 100 تومتوك حقيبة صدر T35 Delivard Store 846 P 0
8777 100 تومتوك حقيبة صدر T35 Delivard Store 846 V 8776
8779 100 تومتوك حقيبة كتف Navigator-T24 Delivard Store 847 P 0
8780 100 تومتوك حقيبة كتف Navigator-T24 Delivard Store 847 V 8779
8781 100 تومتوك حقيبة كتف Navigator-T24 Delivard Store 847 V 8779
8782 100 تومتوك حقيبة كتف Navigator-T24 Delivard Store 847 V 8779
8838 100 تومتوك حقيبة إكسسوارات Navigator-T13 بسعة 2.4 لتر Delivard Store 851 P 0
8840 100 تومتوك حقيبة إكسسوارات Navigator-T13 بسعة 2.4 لتر Delivard Store 851 V 8838
8910 100 تومتوك حقيبة جوازات Navigator-T03 لأربع جوازات سفر Delivard Store 858 P 0
8911 100 تومتوك حقيبة جوازات Navigator-T03 لأربع جوازات سفر Delivard Store 858 V 8910
8916 100 تومتوك حقيبة آيباد FancyCase-B06 مقاس 12.9 بوصة Delivard Store 859 P 0
8917 100 تومتوك حقيبة آيباد FancyCase-B06 مقاس 12.9 بوصة Delivard Store 859 V 8916
8601 100 Hama Perth 15.6" Backpack – Black Delivard Store 863 P 0
8931 100 Hama Perth 15.6" Backpack – Black Delivard Store 863 V 8601
8932 100 Hama Perth 15.6" Backpack – Black Delivard Store 863 V 8601
8936 100 تومتوك حقيبة لابتوب Defender-A22 Delivard Store 865 P 0
8937 100 تومتوك حقيبة لابتوب Defender-A22 Delivard Store 865 V 8936
8939 100 تومتوك حقيبة لابتوب Defender-A22 Delivard Store 865 V 8936
8940 100 تومتوك حقيبة لابتوب Defender-A22 Delivard Store 865 V 8936
8941 100 تومتوك حقيبة لابتوب Defender-A22 Delivard Store 865 V 8936
8943 100 تومتوك حقيبة لابتوب Defender-A22 Delivard Store 865 V 8936