SELECT 
  cscart_products.*, 
  cscart_product_descriptions.*, 
  MIN(
    IF(
      cscart_product_prices.percentage_discount = 0, 
      cscart_product_prices.price, 
      cscart_product_prices.price - (
        cscart_product_prices.price * cscart_product_prices.percentage_discount
      )/ 100
    )
  ) as price, 
  GROUP_CONCAT(
    CASE WHEN (
      cscart_products_categories.link_type = 'M'
    ) THEN CONCAT(
      cscart_products_categories.category_id, 
      'M'
    ) ELSE cscart_products_categories.category_id END 
    ORDER BY 
      cscart_categories.storefront_id IN (0, 1) DESC, 
      (
        cscart_products_categories.link_type = 'M'
      ) DESC, 
      cscart_products_categories.category_position ASC, 
      cscart_products_categories.category_id ASC
  ) as category_ids, 
  popularity.total as popularity, 
  company_descr.i18n_company as company_name, 
  cscart_product_sales.amount as sales_amount, 
  cscart_seo_names.name as seo_name, 
  cscart_seo_names.path as seo_path, 
  cscart_discussion.type as discussion_type, 
  cscart_product_review_prepared_data.average_rating average_rating, 
  cscart_product_review_prepared_data.reviews_count product_reviews_count, 
  user.firstname AS user_firstname, 
  user.lastname AS user_lastname, 
  user.user_id AS user_id, 
  profi_i.image_path AS avatar_image_image_path, 
  profi_i.image_x AS avatar_image_image_x, 
  profi_i.image_y AS avatar_image_image_y, 
  profi_i.is_high_res AS avatar_image_is_high_res, 
  profi_d.image_path AS avatar_detailed_image_path, 
  profi_d.image_x AS avatar_detailed_image_x, 
  profi_d.image_y AS avatar_detailed_image_y, 
  profi_d.is_high_res AS avatar_detailed_is_high_res, 
  profil.pair_id AS avatar_pair_id, 
  profil.image_id AS avatar_image_id, 
  profil.detailed_id AS avatar_detailed_id, 
  cf.category_filter_id, 
  cfd.title as category_filter_title, 
  cfv.category_filter_value_id, 
  cfvd.title as category_filter_value_title, 
  c4pcmain.unit_size as unit_size, 
  pcmain.category_id AS main_category, 
  cd4pcmain.category AS main_category_title, 
  SUBSTRING_INDEX(
    cscart_categories.id_path, "/", 1
  ) AS root_category, 
  cdroot4pcmain.category AS root_category_title, 
  cscart_product_prices.price_piloted AS price_piloted, 
  cscart_product_prices.price_selfplay AS price_selfplay, 
  cscart_categories.product_template 
FROM 
  cscart_products 
  LEFT JOIN cscart_product_prices ON cscart_product_prices.product_id = cscart_products.product_id 
  AND cscart_product_prices.lower_limit = 1 
  AND cscart_product_prices.usergroup_id IN (0, 0, 1) 
  LEFT JOIN cscart_product_descriptions ON cscart_product_descriptions.product_id = cscart_products.product_id 
  AND cscart_product_descriptions.lang_code = 'en' 
  LEFT JOIN cscart_company_descriptions as company_descr ON company_descr.company_id = cscart_products.company_id 
  AND company_descr.lang_code = 'en' 
  LEFT JOIN cscart_companies as companies ON companies.company_id = cscart_products.company_id 
  INNER JOIN cscart_products_categories ON cscart_products_categories.product_id = cscart_products.product_id 
  INNER JOIN cscart_categories ON cscart_categories.category_id = cscart_products_categories.category_id 
  AND cscart_categories.storefront_id IN (0, 1) 
  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_products.usergroup_ids = '' 
    OR FIND_IN_SET(
      0, cscart_products.usergroup_ids
    ) 
    OR FIND_IN_SET(
      1, cscart_products.usergroup_ids
    )
  ) 
  AND cscart_categories.status IN ('A', 'H') 
  AND cscart_products.status IN ('A', 'H') 
  LEFT JOIN cscart_product_popularity as popularity ON popularity.product_id = cscart_products.product_id 
  LEFT JOIN cscart_product_sales ON cscart_product_sales.product_id = cscart_products.product_id 
  AND cscart_product_sales.category_id = 44 
  LEFT JOIN cscart_seo_names ON cscart_seo_names.object_id = 2247 
  AND cscart_seo_names.type = 'p' 
  AND cscart_seo_names.dispatch = '' 
  AND cscart_seo_names.lang_code = 'en' 
  LEFT JOIN cscart_discussion ON cscart_discussion.object_id = cscart_products.product_id 
  AND cscart_discussion.object_type = 'P' 
  LEFT JOIN cscart_product_review_prepared_data ON cscart_product_review_prepared_data.product_id = cscart_products.product_id 
  AND cscart_product_review_prepared_data.storefront_id = 0 
  LEFT JOIN cscart_users as user ON user.user_id = (
    SELECT 
      user_id 
    FROM 
      cscart_users as tu 
    WHERE 
      tu.company_id = companies.company_id 
    LIMIT 
      1
  ) LEFT JOIN cscart_profile_images_links as profil ON user.user_id = profil.profile_id 
  AND field_name = "avatar" 
  LEFT JOIN cscart_profile_images as profi_i ON profi_i.image_id = profil.image_id 
  LEFT JOIN cscart_profile_images as profi_d ON profi_d.image_id = profil.detailed_id 
  LEFT JOIN cscart_category_filter_products cfp ON cfp.product_id = cscart_products.product_id 
  LEFT JOIN cscart_category_filters cf ON cf.category_filter_id = cfp.category_filter_id 
  LEFT JOIN cscart_category_filter_descriptions cfd ON cfd.category_filter_id = cf.category_filter_id 
  AND cfd.lang_code = 'en' 
  LEFT JOIN cscart_category_filter_values cfv ON cfv.category_filter_value_id = cfp.value 
  LEFT JOIN cscart_category_filter_value_descriptions cfvd ON cfvd.category_filter_value_id = cfv.category_filter_value_id 
  AND cfvd.lang_code = 'en' 
  LEFT JOIN cscart_products_categories as pcmain ON pcmain.product_id = cscart_products.product_id 
  AND pcmain.link_type = "M" 
  LEFT JOIN cscart_categories as c4pcmain ON c4pcmain.category_id = pcmain.category_id 
  LEFT JOIN cscart_category_descriptions as cd4pcmain ON cd4pcmain.category_id = pcmain.category_id 
  AND cd4pcmain.lang_code = 'en' 
  LEFT JOIN cscart_category_descriptions as cdroot4pcmain ON cdroot4pcmain.category_id = SUBSTRING_INDEX(
    cscart_categories.id_path, "/", 1
  ) 
  AND cdroot4pcmain.lang_code = 'en' 
WHERE 
  cscart_products.product_id = 2247 
  AND (
    companies.status IN ('A') 
    OR cscart_products.company_id = 0
  ) 
  AND (
    cf.category_id IS NULL 
    OR cf.category_id IN (44)
  ) 
  AND cscart_categories.status = 'A' 
  AND cscart_products.status = 'A' 
GROUP BY 
  cscart_products.product_id

Query time 0.00450

JSON explain

{
  "query_block": {
    "select_id": 1,
    "table": {
      "table_name": "cscart_products",
      "access_type": "const",
      "possible_keys": ["PRIMARY", "status"],
      "key": "PRIMARY",
      "key_length": "3",
      "used_key_parts": ["product_id"],
      "ref": ["const"],
      "rows": 1,
      "filtered": 100
    },
    "table": {
      "table_name": "popularity",
      "access_type": "const",
      "possible_keys": ["PRIMARY", "total"],
      "key": "PRIMARY",
      "key_length": "3",
      "used_key_parts": ["product_id"],
      "ref": ["const"],
      "rows": 1,
      "filtered": 100
    },
    "table": {
      "table_name": "cscart_product_sales",
      "access_type": "const",
      "possible_keys": ["PRIMARY", "pa"],
      "key": "PRIMARY",
      "key_length": "6",
      "used_key_parts": ["category_id", "product_id"],
      "ref": ["const", "const"],
      "rows": 0,
      "filtered": 0,
      "unique_row_not_found": true
    },
    "table": {
      "table_name": "cscart_product_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": ["const"],
      "rows": 1,
      "filtered": 0.132890359,
      "attached_condition": "trigcond(cscart_product_prices.lower_limit = 1 and cscart_product_prices.usergroup_id in (0,0,1))"
    },
    "block-nl-join": {
      "table": {
        "table_name": "cscart_product_descriptions",
        "access_type": "range",
        "possible_keys": ["PRIMARY", "product_id"],
        "key": "PRIMARY",
        "key_length": "9",
        "used_key_parts": ["product_id", "lang_code"],
        "rows": 1,
        "filtered": 100,
        "attached_condition": "cscart_product_descriptions.product_id = 2247 and cscart_product_descriptions.lang_code = 'en'"
      },
      "buffer_type": "flat",
      "buffer_size": "576",
      "join_type": "BNL",
      "attached_condition": "trigcond(1) and trigcond(cscart_product_descriptions.product_id = 2247 and cscart_product_descriptions.lang_code = 'en')"
    },
    "table": {
      "table_name": "company_descr",
      "access_type": "eq_ref",
      "possible_keys": ["PRIMARY"],
      "key": "PRIMARY",
      "key_length": "10",
      "used_key_parts": ["company_id", "lang_code"],
      "ref": ["const", "const"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "trigcond(company_descr.lang_code = 'en')"
    },
    "table": {
      "table_name": "companies",
      "access_type": "eq_ref",
      "possible_keys": ["PRIMARY"],
      "key": "PRIMARY",
      "key_length": "4",
      "used_key_parts": ["company_id"],
      "ref": ["const"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "trigcond(companies.`status` = 'A')"
    },
    "table": {
      "table_name": "cscart_products_categories",
      "access_type": "ref",
      "possible_keys": ["PRIMARY", "pt"],
      "key": "pt",
      "key_length": "3",
      "used_key_parts": ["product_id"],
      "ref": ["const"],
      "rows": 1,
      "filtered": 100
    },
    "table": {
      "table_name": "cscart_categories",
      "access_type": "ref",
      "possible_keys": ["PRIMARY", "c_status", "p_category_id"],
      "key": "p_category_id",
      "key_length": "3",
      "used_key_parts": ["category_id"],
      "ref": ["dev.cscart_products_categories.category_id"],
      "rows": 1,
      "filtered": 100,
      "index_condition": "cscart_categories.`status` = 'A' 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')",
      "attached_condition": "cscart_categories.storefront_id in (0,1)"
    },
    "table": {
      "table_name": "cscart_seo_names",
      "access_type": "ref",
      "possible_keys": ["PRIMARY", "dispatch"],
      "key": "PRIMARY",
      "key_length": "206",
      "used_key_parts": ["object_id", "type", "dispatch", "lang_code"],
      "ref": ["const", "const", "const", "const"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "trigcond(cscart_seo_names.`type` = 'p' and cscart_seo_names.dispatch = '' and cscart_seo_names.lang_code = 'en')"
    },
    "table": {
      "table_name": "cscart_discussion",
      "access_type": "const",
      "possible_keys": ["object_id"],
      "key": "object_id",
      "key_length": "6",
      "used_key_parts": ["object_id", "object_type"],
      "ref": ["const", "const"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "trigcond(cscart_discussion.object_type = 'P')"
    },
    "table": {
      "table_name": "cscart_product_review_prepared_data",
      "access_type": "const",
      "possible_keys": ["PRIMARY"],
      "key": "PRIMARY",
      "key_length": "7",
      "used_key_parts": ["product_id", "storefront_id"],
      "ref": ["const", "const"],
      "rows": 1,
      "filtered": 100
    },
    "table": {
      "table_name": "user",
      "access_type": "eq_ref",
      "possible_keys": ["PRIMARY"],
      "key": "PRIMARY",
      "key_length": "3",
      "used_key_parts": ["user_id"],
      "ref": ["func"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "trigcond(`user`.user_id = (subquery#2))"
    },
    "table": {
      "table_name": "profil",
      "access_type": "ref",
      "possible_keys": ["profile_id"],
      "key": "profile_id",
      "key_length": "102",
      "used_key_parts": ["profile_id", "field_name"],
      "ref": ["dev.user.user_id", "const"],
      "rows": 2,
      "filtered": 100,
      "attached_condition": "trigcond(`user`.user_id = profil.profile_id and profil.field_name = 'avatar' and trigcond(`user`.user_id is not null))"
    },
    "table": {
      "table_name": "profi_i",
      "access_type": "eq_ref",
      "possible_keys": ["PRIMARY"],
      "key": "PRIMARY",
      "key_length": "4",
      "used_key_parts": ["image_id"],
      "ref": ["dev.profil.image_id"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "trigcond(trigcond(profil.image_id is not null))"
    },
    "table": {
      "table_name": "profi_d",
      "access_type": "eq_ref",
      "possible_keys": ["PRIMARY"],
      "key": "PRIMARY",
      "key_length": "4",
      "used_key_parts": ["image_id"],
      "ref": ["dev.profil.detailed_id"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "trigcond(trigcond(profil.detailed_id is not null))"
    },
    "block-nl-join": {
      "table": {
        "table_name": "cfp",
        "access_type": "ALL",
        "rows": 5774,
        "filtered": 100,
        "attached_condition": "cfp.product_id = 2247"
      },
      "buffer_type": "flat",
      "buffer_size": "143Kb",
      "join_type": "BNL",
      "attached_condition": "trigcond(cfp.product_id = 2247)"
    },
    "table": {
      "table_name": "cf",
      "access_type": "ref",
      "possible_keys": ["PRIMARY"],
      "key": "PRIMARY",
      "key_length": "4",
      "used_key_parts": ["category_filter_id"],
      "ref": ["dev.cfp.category_filter_id"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "trigcond(cf.category_id is null or cf.category_id = 44) and trigcond(trigcond(cfp.category_filter_id is not null))",
      "using_index": true
    },
    "block-nl-join": {
      "table": {
        "table_name": "cfd",
        "access_type": "ALL",
        "possible_keys": ["PRIMARY"],
        "rows": 639,
        "filtered": 100,
        "attached_condition": "cfd.lang_code = 'en'"
      },
      "buffer_type": "flat",
      "buffer_size": "256Kb",
      "join_type": "BNL",
      "attached_condition": "trigcond(cfd.category_filter_id = cf.category_filter_id and cfd.lang_code = 'en')"
    },
    "table": {
      "table_name": "cfv",
      "access_type": "eq_ref",
      "possible_keys": ["PRIMARY"],
      "key": "PRIMARY",
      "key_length": "4",
      "used_key_parts": ["category_filter_value_id"],
      "ref": ["dev.cfp.value"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "trigcond(cfv.category_filter_value_id = cfp.`value` and trigcond(cfp.`value` is not null))",
      "using_index": true
    },
    "table": {
      "table_name": "cfvd",
      "access_type": "eq_ref",
      "possible_keys": ["PRIMARY"],
      "key": "PRIMARY",
      "key_length": "10",
      "used_key_parts": ["category_filter_value_id", "lang_code"],
      "ref": ["dev.cfv.category_filter_value_id", "const"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "trigcond(cfvd.lang_code = 'en' and trigcond(cfv.category_filter_value_id is not null))"
    },
    "table": {
      "table_name": "pcmain",
      "access_type": "ref",
      "possible_keys": ["link_type", "pt"],
      "key": "pt",
      "key_length": "6",
      "used_key_parts": ["product_id", "link_type"],
      "ref": ["const", "const"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "trigcond(pcmain.link_type = 'M')"
    },
    "table": {
      "table_name": "c4pcmain",
      "access_type": "eq_ref",
      "possible_keys": ["PRIMARY", "p_category_id"],
      "key": "PRIMARY",
      "key_length": "3",
      "used_key_parts": ["category_id"],
      "ref": ["dev.pcmain.category_id"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "trigcond(trigcond(pcmain.category_id is not null))"
    },
    "table": {
      "table_name": "cd4pcmain",
      "access_type": "eq_ref",
      "possible_keys": ["PRIMARY"],
      "key": "PRIMARY",
      "key_length": "9",
      "used_key_parts": ["category_id", "lang_code"],
      "ref": ["dev.pcmain.category_id", "const"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "trigcond(cd4pcmain.lang_code = 'en' and trigcond(pcmain.category_id is not null))"
    },
    "table": {
      "table_name": "cdroot4pcmain",
      "access_type": "eq_ref",
      "possible_keys": ["PRIMARY"],
      "key": "PRIMARY",
      "key_length": "9",
      "used_key_parts": ["category_id", "lang_code"],
      "ref": ["func", "const"],
      "rows": 1,
      "filtered": 100,
      "attached_condition": "trigcond(cdroot4pcmain.category_id = substring_index(cscart_categories.id_path,'/',1) and cdroot4pcmain.lang_code = 'en')"
    },
    "subqueries": [
      {
        "expression_cache": {
          "state": "uninitialized",
          "query_block": {
            "select_id": 2,
            "table": {
              "table_name": "tu",
              "access_type": "ALL",
              "rows": 89,
              "filtered": 100,
              "attached_condition": "tu.company_id = companies.company_id"
            }
          }
        }
      }
    ]
  }
}

Result

product_id product_code product_type status company_id list_price amount weight length width height shipping_freight low_avail_limit timestamp updated_timestamp usergroup_ids is_edp edp_shipping unlimited_download tracking free_shipping zero_price_action is_pbp is_op is_oper is_returnable return_period avail_since out_of_stock_actions localization min_qty max_qty qty_step list_qty_count tax_ids age_verification age_limit options_type exceptions_type details_layout shipping_params facebook_obj_type parent_product_id buy_now_url min_amount paused lang_code product shortname short_description full_description meta_keywords meta_description search_words page_title age_warning_message promo_text price category_ids popularity company_name sales_amount seo_name seo_path discussion_type average_rating product_reviews_count user_firstname user_lastname user_id avatar_image_image_path avatar_image_image_x avatar_image_image_y avatar_image_is_high_res avatar_detailed_image_path avatar_detailed_image_x avatar_detailed_image_y avatar_detailed_is_high_res avatar_pair_id avatar_image_id avatar_detailed_id category_filter_id category_filter_title category_filter_value_id category_filter_value_title unit_size main_category main_category_title root_category root_category_title price_piloted price_selfplay product_template
2247 P A 18 500000 0.000 0 0 0 0.00 0 1739375429 1739375429 0 N N N B N N N N Y 10 0 N N 0 a:5:{s:16:"min_items_in_box";i:0;s:16:"max_items_in_box";i:0;s:10:"box_length";i:0;s:9:"box_width";i:0;s:10:"box_height";i:0;} 0 35.0000000000 N en Khadgar - Alliance 37.4500000000000000 44M,44M 153 Encrypticxls khadgar-alliance-en-2 43/44 D FastGold 80 a2e272d0e12f.png 200 200 11 0 11 19 Server 208 Khadgar 1.00 44 Gold 43 World of Warcraft currency