SELECT 
  products.product_id, 
  descr1.product as product, 
  companies.company as company_name, 
  cscart_supplier_links.supplier_id, 
  products.product_type, 
  products.parent_product_id, 
  products.master_product_offers_count, 
  products.master_product_id, 
  products.company_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 = 'en' 
  AND c_var.variant_id = 59786 
  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 
  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_supplier_links ON cscart_supplier_links.object_id = products.product_id 
  AND cscart_supplier_links.object_type = 'P' 
  LEFT JOIN cscart_master_products_storefront_offers_count AS master_products_storefront_offers_count ON master_products_storefront_offers_count.product_id = products.product_id 
  AND master_products_storefront_offers_count.storefront_id = 1 
  LEFT JOIN cscart_product_sales ON cscart_product_sales.product_id = products.product_id 
  AND cscart_product_sales.category_id = products_categories.category_id 
WHERE 
  1 
  AND (
    companies.status IN ('A') 
    OR products.company_id = 0
  ) 
  AND products.company_id IN (13, 0) 
  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.master_product_status IN ('A') 
  AND products.master_product_id = 0 
  AND (
    products.company_id > 0 
    OR master_products_storefront_offers_count.count > 0
  ) 
GROUP BY 
  products.product_id 
ORDER BY 
  cscart_product_sales.amount desc, 
  products.product_id ASC 
LIMIT 
  0, 48

Query time 0.00179

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "7.00"
    },
    "ordering_operation": {
      "using_filesort": true,
      "grouping_operation": {
        "using_temporary_table": true,
        "using_filesort": false,
        "nested_loop": [
          {
            "table": {
              "table_name": "master_products_storefront_offers_count",
              "access_type": "system",
              "possible_keys": [
                "PRIMARY",
                "idx_storefront_id"
              ],
              "rows_examined_per_scan": 0,
              "rows_produced_per_join": 1,
              "filtered": "0.00",
              "const_row_not_found": true,
              "cost_info": {
                "read_cost": "0.00",
                "eval_cost": "0.10",
                "prefix_cost": "0.00",
                "data_read_per_join": "16"
              },
              "used_columns": [
                "storefront_id",
                "product_id",
                "count"
              ]
            }
          },
          {
            "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": 33,
              "rows_produced_per_join": 16,
              "filtered": "50.00",
              "using_index": true,
              "cost_info": {
                "read_cost": "0.63",
                "eval_cost": "1.65",
                "prefix_cost": "3.93",
                "data_read_per_join": "660"
              },
              "used_columns": [
                "feature_id",
                "product_id",
                "variant_id",
                "lang_code"
              ],
              "attached_condition": "(`cscart_db`.`c_var`.`lang_code` = 'en')"
            }
          },
          {
            "table": {
              "table_name": "products",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY",
                "age_verification",
                "status",
                "idx_parent_product_id",
                "idx_master_product_id",
                "youtube_link"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "product_id"
              ],
              "key_length": "3",
              "ref": [
                "cscart_db.c_var.product_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 0,
              "filtered": "5.00",
              "cost_info": {
                "read_cost": "0.00",
                "eval_cost": "0.08",
                "prefix_cost": "5.58",
                "data_read_per_join": "4K"
              },
              "used_columns": [
                "product_id",
                "product_type",
                "status",
                "company_id",
                "usergroup_ids",
                "parent_product_id",
                "master_product_id",
                "master_product_status",
                "master_product_offers_count"
              ],
              "attached_condition": "((`cscart_db`.`products`.`master_product_id` = 0) and (`cscart_db`.`products`.`parent_product_id` = 0) and (`cscart_db`.`products`.`company_id` in (13,0)) and ((`cscart_db`.`products`.`usergroup_ids` = '') or (0 <> find_in_set(0,`cscart_db`.`products`.`usergroup_ids`)) or (0 <> find_in_set(1,`cscart_db`.`products`.`usergroup_ids`))) and (`cscart_db`.`products`.`status` = 'A') and (`cscart_db`.`products`.`master_product_status` = 'A') and ((`cscart_db`.`products`.`company_id` > 0) or <cache>((NULL > 0))))"
            }
          },
          {
            "table": {
              "table_name": "companies",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "company_id"
              ],
              "key_length": "4",
              "ref": [
                "cscart_db.products.company_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 0,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "0.00",
                "eval_cost": "0.08",
                "prefix_cost": "5.66",
                "data_read_per_join": "5K"
              },
              "used_columns": [
                "company_id",
                "status",
                "company"
              ],
              "attached_condition": "<if>(found_match(companies), ((`cscart_db`.`companies`.`status` = 'A') or (`cscart_db`.`products`.`company_id` = 0)), true)"
            }
          },
          {
            "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": [
                "cscart_db.c_var.product_id",
                "const"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 0,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "0.00",
                "eval_cost": "0.08",
                "prefix_cost": "5.74",
                "data_read_per_join": "3K"
              },
              "used_columns": [
                "product_id",
                "lang_code",
                "product"
              ]
            }
          },
          {
            "table": {
              "table_name": "cscart_supplier_links",
              "access_type": "ref",
              "possible_keys": [
                "object_id"
              ],
              "key": "object_id",
              "used_key_parts": [
                "object_id",
                "object_type"
              ],
              "key_length": "7",
              "ref": [
                "cscart_db.c_var.product_id",
                "const"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 0,
              "filtered": "100.00",
              "index_condition": "<if>(is_not_null_compl(cscart_supplier_links), (`cscart_db`.`cscart_supplier_links`.`object_id` = `cscart_db`.`c_var`.`product_id`), true)",
              "cost_info": {
                "read_cost": "0.21",
                "eval_cost": "0.08",
                "prefix_cost": "6.03",
                "data_read_per_join": "13"
              },
              "used_columns": [
                "supplier_id",
                "object_id",
                "object_type"
              ]
            }
          },
          {
            "table": {
              "table_name": "prices",
              "access_type": "ref",
              "possible_keys": [
                "usergroup",
                "product_id",
                "lower_limit",
                "usergroup_id",
                "idx_product_prices_usergroup_limit"
              ],
              "key": "product_id",
              "used_key_parts": [
                "product_id"
              ],
              "key_length": "3",
              "ref": [
                "cscart_db.c_var.product_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 0,
              "filtered": "99.99",
              "cost_info": {
                "read_cost": "0.21",
                "eval_cost": "0.08",
                "prefix_cost": "6.32",
                "data_read_per_join": "19"
              },
              "used_columns": [
                "product_id",
                "lower_limit",
                "usergroup_id"
              ],
              "attached_condition": "((`cscart_db`.`prices`.`lower_limit` = 1) and (`cscart_db`.`prices`.`usergroup_id` in (0,0,1)))"
            }
          },
          {
            "table": {
              "table_name": "products_categories",
              "access_type": "ref",
              "possible_keys": [
                "PRIMARY",
                "pt"
              ],
              "key": "pt",
              "used_key_parts": [
                "product_id"
              ],
              "key_length": "3",
              "ref": [
                "cscart_db.c_var.product_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 0,
              "filtered": "100.00",
              "using_index": true,
              "cost_info": {
                "read_cost": "0.49",
                "eval_cost": "0.09",
                "prefix_cost": "6.90",
                "data_read_per_join": "14"
              },
              "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": [
                "cscart_db.products_categories.category_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 0,
              "filtered": "5.00",
              "cost_info": {
                "read_cost": "0.00",
                "eval_cost": "0.00",
                "prefix_cost": "6.99",
                "data_read_per_join": "131"
              },
              "used_columns": [
                "category_id",
                "usergroup_ids",
                "status",
                "storefront_id"
              ],
              "attached_condition": "(((`cscart_db`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`cscart_db`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`cscart_db`.`cscart_categories`.`usergroup_ids`))) and (`cscart_db`.`cscart_categories`.`status` in ('A','H')) and (`cscart_db`.`cscart_categories`.`storefront_id` in (0,1)))"
            }
          },
          {
            "table": {
              "table_name": "cscart_product_sales",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY",
                "pa"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "category_id",
                "product_id"
              ],
              "key_length": "6",
              "ref": [
                "cscart_db.products_categories.category_id",
                "cscart_db.c_var.product_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 0,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "0.00",
                "eval_cost": "0.00",
                "prefix_cost": "7.00",
                "data_read_per_join": "0"
              },
              "used_columns": [
                "category_id",
                "product_id",
                "amount"
              ]
            }
          }
        ]
      }
    }
  }
}

Result

product_id product company_name supplier_id product_type parent_product_id master_product_offers_count master_product_id company_id
66798 Daisy - EDP for Women 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66799 New World - EDP for Women 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66800 Secret Sunshine - EDP for Women 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66801 Nameless Gangster - EDP for Men 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66802 The Outlaws - EDP for Men 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66803 Big match - EDP for Women 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66804 Cyborg - EDP for Men 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66805 Dirty Carnival - EDP for Women 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66806 For the wedding - EDP for Women 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66807 K-Bloom - EDP for Women 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66808 King Maker - EDP for Men 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66809 The Classic - EDP for Men 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66810 Gangnam Blues - EDP for Men 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66811 Madame Freedom - EDP for Women 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66812 Friend - EDP for Men 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66813 Sweet & Sour - EDP for Women 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66814 The Pirates - EDP for Men 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66815 The Beauty Inside - EDP for Women 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66816 Old Boy - EDP for Men 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66817 Secret Obsession - EDP for Men 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66818 Divine Move - EDP for Women 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66819 The Merciless - EDP for Men 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66820 Hitman - EDP for Men 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66821 The King - EDP for Men 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66822 Daisy 100ml - EDP for Women 100ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66823 Lady Vengeance - EDP for Women 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66824 Nameless Gangster 100ml - EDP for Men 100ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66825 Old Boy 100ml - EDP for Men 100ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66826 Secret Obsession 100ml - EDP for Men 100ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66827 Lady Vengeance 100ml - EDP for Women 100ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66828 Sassy Girl - EDP for Women 50ml Roadskye Tradecom Pvt. Ltd. 751 P 0 0 0 13
66904 Secret Obsession - EDP for Women 8ml Roadskye Tradecom Pvt. Ltd. 698 P 0 0 0 13
66905 K-Bloom - EDP for Women 8ml Roadskye Tradecom Pvt. Ltd. 698 P 0 0 0 13