SELECT 
  ushop_products.*, 
  ushop_product_descriptions.*, 
  MIN(
    IF(
      ushop_product_prices.percentage_discount = 0, 
      ushop_product_prices.price, 
      ushop_product_prices.price - (
        ushop_product_prices.price * ushop_product_prices.percentage_discount
      )/ 100
    )
  ) as price, 
  GROUP_CONCAT(
    CASE WHEN (
      ushop_products_categories.link_type = 'M'
    ) THEN CONCAT(
      ushop_products_categories.category_id, 
      'M'
    ) ELSE ushop_products_categories.category_id END 
    ORDER BY 
      ushop_categories.storefront_id IN (0, 1) DESC, 
      (
        ushop_products_categories.link_type = 'M'
      ) DESC, 
      ushop_products_categories.category_position ASC, 
      ushop_products_categories.category_id ASC
  ) as category_ids, 
  popularity.total as popularity, 
  companies.company as company_name, 
  ushop_products.is_returnable, 
  ushop_products.return_period, 
  ushop_product_sales.amount as sales_amount, 
  ushop_seo_names.name as seo_name, 
  ushop_seo_names.path as seo_path, 
  ushop_booking_and_reservation.booking_type as booking_type, 
  ushop_booking_and_reservation.date_from as date_from, 
  ushop_booking_and_reservation.date_to as date_to, 
  ushop_booking_and_reservation.book_time as book_time, 
  ushop_booking_and_reservation.break_time as break_time, 
  ushop_booking_and_reservation.week_data as week_data, 
  ushop_booking_and_reservation.apply_same_slots as apply_same_slots, 
  ushop_discussion.type as discussion_type, 
  ushop_product_review_prepared_data.average_rating average_rating, 
  ushop_product_review_prepared_data.reviews_count product_reviews_count 
FROM 
  ushop_products 
  LEFT JOIN ushop_product_prices ON ushop_product_prices.product_id = ushop_products.product_id 
  AND ushop_product_prices.lower_limit = 1 
  AND ushop_product_prices.usergroup_id IN (0, 0, 1) 
  LEFT JOIN ushop_product_descriptions ON ushop_product_descriptions.product_id = ushop_products.product_id 
  AND ushop_product_descriptions.lang_code = 'en' 
  LEFT JOIN ushop_companies as companies ON companies.company_id = ushop_products.company_id 
  INNER JOIN ushop_products_categories ON ushop_products_categories.product_id = ushop_products.product_id 
  INNER JOIN ushop_categories ON ushop_categories.category_id = ushop_products_categories.category_id 
  AND ushop_categories.storefront_id IN (0, 1) 
  AND (
    ushop_categories.usergroup_ids = '' 
    OR FIND_IN_SET(
      0, ushop_categories.usergroup_ids
    ) 
    OR FIND_IN_SET(
      1, ushop_categories.usergroup_ids
    )
  ) 
  AND (
    ushop_products.usergroup_ids = '' 
    OR FIND_IN_SET(0, ushop_products.usergroup_ids) 
    OR FIND_IN_SET(1, ushop_products.usergroup_ids)
  ) 
  AND ushop_categories.status IN ('A', 'H') 
  AND ushop_products.status IN ('A', 'H') 
  LEFT JOIN ushop_product_popularity as popularity ON popularity.product_id = ushop_products.product_id 
  LEFT JOIN ushop_product_sales ON ushop_product_sales.product_id = ushop_products.product_id 
  AND ushop_product_sales.category_id = 362 
  LEFT JOIN ushop_seo_names ON ushop_seo_names.object_id = 407 
  AND ushop_seo_names.type = 'p' 
  AND ushop_seo_names.dispatch = '' 
  AND ushop_seo_names.lang_code = 'es' 
  LEFT JOIN ushop_cp_auctions as auctions ON ushop_products.product_id = auctions.product_id 
  LEFT JOIN ushop_users ON ushop_products.company_id = ushop_users.company_id 
  AND ushop_users.user_type = 'V' 
  AND ushop_users.user_id = 0 
  LEFT JOIN ushop_booking_and_reservation ON ushop_booking_and_reservation.product_id = ushop_products.product_id 
  AND ushop_booking_and_reservation.product_id = 407 
  LEFT JOIN ushop_discussion ON ushop_discussion.object_id = ushop_products.product_id 
  AND ushop_discussion.object_type = 'P' 
  LEFT JOIN ushop_product_review_prepared_data ON ushop_product_review_prepared_data.product_id = ushop_products.product_id 
  AND ushop_product_review_prepared_data.storefront_id = 0 
WHERE 
  ushop_products.product_id = 407 
  AND (
    companies.status IN ('A') 
    OR ushop_products.company_id = 0
  ) 
  AND (
    CASE WHEN (
      ushop_products.cp_active_auction_id > 0
    ) THEN (
      auctions.users = '' 
      OR FIND_IN_SET(0, auctions.users)
    ) ELSE 1 END 
    OR ushop_users.company_id = ushop_products.company_id
  ) 
GROUP BY 
  ushop_products.product_id

Query time 0.00221

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "1.05"
    },
    "grouping_operation": {
      "using_filesort": false,
      "nested_loop": [
        {
          "table": {
            "table_name": "ushop_products",
            "access_type": "const",
            "possible_keys": [
              "PRIMARY",
              "status"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "product_id"
            ],
            "key_length": "3",
            "ref": [
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 1,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.00",
              "eval_cost": "0.10",
              "prefix_cost": "0.00",
              "data_read_per_join": "4K"
            },
            "used_columns": [
              "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",
              "parent_product_id",
              "buy_now_url",
              "units_in_product",
              "show_price_per_x_units",
              "ab__stickers_manual_ids",
              "ab__stickers_generated_ids",
              "cp_active_auction_id",
              "recommended_products_synced",
              "user_reports_count",
              "user_reports_banned_count",
              "video_link",
              "enable_buynow",
              "ia_resumen_reviews",
              "ia_resumen_actualizado",
              "ia_resumen_pendiente",
              "is_rfq",
              "enable_offer",
              "minimum_price_make_an_offer",
              "time_limit_of_make_an_offer"
            ]
          }
        },
        {
          "table": {
            "table_name": "popularity",
            "access_type": "const",
            "possible_keys": [
              "PRIMARY",
              "total"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "product_id"
            ],
            "key_length": "3",
            "ref": [
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 1,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.00",
              "eval_cost": "0.10",
              "prefix_cost": "0.00",
              "data_read_per_join": "32"
            },
            "used_columns": [
              "product_id",
              "total"
            ]
          }
        },
        {
          "table": {
            "table_name": "ushop_product_sales",
            "access_type": "const",
            "possible_keys": [
              "PRIMARY",
              "pa"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "category_id",
              "product_id"
            ],
            "key_length": "6",
            "ref": [
              "const",
              "const"
            ],
            "rows_examined_per_scan": 0,
            "rows_produced_per_join": 1,
            "filtered": "0.00",
            "unique_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": [
              "category_id",
              "product_id",
              "amount"
            ]
          }
        },
        {
          "table": {
            "table_name": "ushop_product_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": [
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 1,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.25",
              "eval_cost": "0.10",
              "prefix_cost": "0.35",
              "data_read_per_join": "24"
            },
            "used_columns": [
              "product_id",
              "price",
              "percentage_discount",
              "lower_limit",
              "usergroup_id"
            ],
            "attached_condition": "<if>(is_not_null_compl(ushop_product_prices), ((`marketplace`.`ushop_product_prices`.`lower_limit` = 1) and (`marketplace`.`ushop_product_prices`.`usergroup_id` in (0,0,1))), true)"
          }
        },
        {
          "table": {
            "table_name": "ushop_product_descriptions",
            "access_type": "const",
            "possible_keys": [
              "PRIMARY",
              "product_id"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "product_id",
              "lang_code"
            ],
            "key_length": "9",
            "ref": [
              "const",
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 1,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.00",
              "eval_cost": "0.10",
              "prefix_cost": "0.45",
              "data_read_per_join": "6K"
            },
            "used_columns": [
              "product_id",
              "lang_code",
              "product",
              "shortname",
              "short_description",
              "full_description",
              "meta_keywords",
              "meta_description",
              "search_words",
              "page_title",
              "age_warning_message",
              "promo_text",
              "unit_name",
              "srx_shopshort_link",
              "srx_shopshort_ref",
              "srx_shopshort_qr",
              "srx_shopshort_details"
            ]
          }
        },
        {
          "table": {
            "table_name": "companies",
            "access_type": "const",
            "possible_keys": [
              "PRIMARY"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "company_id"
            ],
            "key_length": "4",
            "ref": [
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 1,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.00",
              "eval_cost": "0.10",
              "prefix_cost": "0.55",
              "data_read_per_join": "6K"
            },
            "used_columns": [
              "company_id",
              "status",
              "company"
            ],
            "attached_condition": "<if>(found_match(companies), ((`marketplace`.`companies`.`status` = 'A') or false), true)"
          }
        },
        {
          "table": {
            "table_name": "ushop_products_categories",
            "access_type": "ref",
            "possible_keys": [
              "PRIMARY",
              "pt"
            ],
            "key": "pt",
            "used_key_parts": [
              "product_id"
            ],
            "key_length": "3",
            "ref": [
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 1,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.25",
              "eval_cost": "0.10",
              "prefix_cost": "0.90",
              "data_read_per_join": "16"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type",
              "category_position"
            ]
          }
        },
        {
          "table": {
            "table_name": "ushop_categories",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY",
              "c_status",
              "p_category_id"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "category_id"
            ],
            "key_length": "3",
            "ref": [
              "marketplace.ushop_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.01",
              "prefix_cost": "1.00",
              "data_read_per_join": "166"
            },
            "used_columns": [
              "category_id",
              "storefront_id",
              "usergroup_ids",
              "status"
            ],
            "attached_condition": "((`marketplace`.`ushop_categories`.`storefront_id` in (0,1)) and ((`marketplace`.`ushop_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`marketplace`.`ushop_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`marketplace`.`ushop_categories`.`usergroup_ids`))) and (`marketplace`.`ushop_categories`.`status` in ('A','H')))"
          }
        },
        {
          "table": {
            "table_name": "ushop_seo_names",
            "access_type": "ref",
            "possible_keys": [
              "PRIMARY",
              "dispatch"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "object_id",
              "type",
              "dispatch",
              "lang_code"
            ],
            "key_length": "206",
            "ref": [
              "const",
              "const",
              "const",
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 0,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.01",
              "eval_cost": "0.01",
              "prefix_cost": "1.02",
              "data_read_per_join": "86"
            },
            "used_columns": [
              "name",
              "object_id",
              "type",
              "dispatch",
              "path",
              "lang_code"
            ]
          }
        },
        {
          "table": {
            "table_name": "auctions",
            "access_type": "ref",
            "possible_keys": [
              "product_id"
            ],
            "key": "product_id",
            "used_key_parts": [
              "product_id"
            ],
            "key_length": "4",
            "ref": [
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 0,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.01",
              "eval_cost": "0.01",
              "prefix_cost": "1.04",
              "data_read_per_join": "10"
            },
            "used_columns": [
              "product_id",
              "users"
            ]
          }
        },
        {
          "table": {
            "table_name": "ushop_users",
            "access_type": "const",
            "possible_keys": [
              "PRIMARY"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "user_id"
            ],
            "key_length": "3",
            "ref": [
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 0,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.00",
              "eval_cost": "0.01",
              "prefix_cost": "1.04",
              "data_read_per_join": "329"
            },
            "used_columns": [
              "user_id",
              "user_type",
              "company_id"
            ],
            "attached_condition": "(<if>(found_match(ushop_users), ((0 <> (case when <cache>(('0' > 0)) then ((`marketplace`.`auctions`.`users` = '') or (0 <> find_in_set(0,`marketplace`.`auctions`.`users`))) else 1 end)) or (`marketplace`.`ushop_users`.`company_id` = '1')), true) and <if>(is_not_null_compl(ushop_users), ((`marketplace`.`ushop_users`.`company_id` = '1') and (`marketplace`.`ushop_users`.`user_type` = 'V')), true))"
          }
        },
        {
          "table": {
            "table_name": "ushop_booking_and_reservation",
            "access_type": "const",
            "possible_keys": [
              "PRIMARY"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "product_id"
            ],
            "key_length": "4",
            "ref": [
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 0,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.00",
              "eval_cost": "0.01",
              "prefix_cost": "1.05",
              "data_read_per_join": "8"
            },
            "used_columns": [
              "product_id",
              "booking_type",
              "date_from",
              "date_to",
              "book_time",
              "break_time",
              "apply_same_slots",
              "week_data"
            ],
            "attached_condition": "<if>(is_not_null_compl(ushop_booking_and_reservation), <cache>((407 = 407)), true)"
          }
        },
        {
          "table": {
            "table_name": "ushop_discussion",
            "access_type": "const",
            "possible_keys": [
              "object_id"
            ],
            "key": "object_id",
            "used_key_parts": [
              "object_id",
              "object_type"
            ],
            "key_length": "6",
            "ref": [
              "const",
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 0,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.00",
              "eval_cost": "0.01",
              "prefix_cost": "1.05",
              "data_read_per_join": "1"
            },
            "used_columns": [
              "object_id",
              "object_type",
              "type"
            ]
          }
        },
        {
          "table": {
            "table_name": "ushop_product_review_prepared_data",
            "access_type": "const",
            "possible_keys": [
              "PRIMARY"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "product_id",
              "storefront_id"
            ],
            "key_length": "7",
            "ref": [
              "const",
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 0,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.00",
              "eval_cost": "0.01",
              "prefix_cost": "1.06",
              "data_read_per_join": "0"
            },
            "used_columns": [
              "product_id",
              "storefront_id",
              "average_rating",
              "reviews_count"
            ]
          }
        }
      ]
    }
  }
}

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 parent_product_id buy_now_url units_in_product show_price_per_x_units ab__stickers_manual_ids ab__stickers_generated_ids cp_active_auction_id recommended_products_synced user_reports_count user_reports_banned_count video_link enable_buynow ia_resumen_reviews ia_resumen_actualizado ia_resumen_pendiente is_rfq enable_offer minimum_price_make_an_offer time_limit_of_make_an_offer lang_code product shortname short_description full_description meta_keywords meta_description search_words page_title age_warning_message promo_text unit_name srx_shopshort_link srx_shopshort_ref srx_shopshort_qr srx_shopshort_details price category_ids popularity company_name sales_amount seo_name seo_path booking_type date_from date_to book_time break_time week_data apply_same_slots discussion_type average_rating product_reviews_count
407 A0127P1V0T P A 1 0.00 10 0.000 0 0 0 0.00 0 1328644800 1759010376 0 N N N N N N N Y 10 0 N 6 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 0.000 1.000 0 1 0 0 Y 0 N N E 0 0 en Fore CR5 SRAM Red <p>An all new frame and new graphics package make the Fore CR5 look as fast as it really is. Now available with SRAM Red componants.</p><p>What do you get when you interview hundreds of riders, questioning them about their desires for the ultimate road bike and then, spend thousands of hours translating those ideas into reality? A dream come true. We call it the Fezzari For&eacute; CR5. It is the pinnacle of road bike performance. From its all new state of the art, proprietary Fezzari Racing Design Xr7 3K monocoque carbon frame to its best-of-market components, the For&eacute; CR5 is THE ultimate road bike. Our designers and engineers didn't cut corners.<br /> <br /> Take, for instance, the state of the art proprietary Fezzari Racing Design Xr7 3K monocoque carbon fiber frame. We used the highest grade of carbon fiber available on the market. We made it even stiffer laterally by enlarging the bottom bracket shell and adding the BB30 bottom bracket/crank design, strengthening the headtube and making it more laterally stiff by enlarging the diameter to a 1.5" tapered design. We've also enlarged the seatstays near the rear axle for more lateral rigidity. We made the Xr7 frame even more vertically compliant for those rides on the cobblestones. We've done this by using an oval design in our top tube and down tube.&nbsp; The new Xr7 frame is even more aerodynamic than before with the new F4 ultralight bladed carbon fork and internal cable routing on the top tube.&nbsp; The Xr7 frame was recently tested to be one of the most durable frames on the market, and it weighs a mere 900 grams. Strength, lightweight, rigidity where you need it most, and flexible enough to take the edge off of rough roads -- it's the perfect frame for anyone who wants to get the most out of their riding experience.<br /> <br /> Next, take a look at the perfect blend of components. The Fore CR5 includes SRAM Red components shifters, brakes and derraileurs, FSA K-Force Light BB30 Carbon Crankset, Fezzari F4 XrT 3K carbon ultralite bladed carbon fork with carbon steerer tube, FSA K-Force compact carbon bars, FSA K- Force carbon seat post, and even carbon spacers on the headset.<br /> <br /> Finally, add the new sleek graphics and logos and you have--the ultimate road ride.<br /> <br /> You get the following upgrades over the CR3:</p><ol><li> <strong>Upgraded Frameset</strong> &ndash; from the Xr5 to the new Xr7 frame,&nbsp; more lateral stiffness with a BB30 crank system, enlarged headtube for better cornering, and sprinting, added rigidity in the rear triangle, increased aerodynamics with the new F4 bladed fork design and internal cable routing.</li><li> <strong>Upgraded Shifters</strong> &ndash; from Shimano Ultegra to the flagship SRAM Red, for smoother, more precise shifting</li><li> <strong>Upgraded Front Derailleur</strong> &ndash; from Shimano Ultegra to SRAM Red, which is lighter and smoother</li><li> <strong>Upgraded Cassette</strong> &ndash; from Shimano Ultegra to SRAM Red</li><li> <strong>Upgraded Crankset</strong> &ndash; from FSA SLK Light to FSA K-Force Light, which is lighter</li><li> <strong>Upgraded Chain</strong> &ndash; from Shimano Ultegra to SRAM Red</li><li> <strong>Upgraded Wheelset</strong> &ndash; Mavic Ksyrium SL, which are lighter,stiffer, faster, and perform better</li><li> <strong>Upgraded Brakes</strong> &ndash; from Shimano Ultegra to SRAM Red, which are lighter and smoother</li><li> <strong>Upgraded Seatpost-&nbsp; </strong>The&nbsp; FSA K-force light seatpost is one of the lightest on the market.&nbsp; It also completes the graphics package complimenting the crank and handle bar.</li></ol><p>When you get a For&eacute; CR5, we custom fit it for you through our 23-Point Custom Setup program. We&rsquo;ll get your specific&nbsp; body measurements so we can outfit your bike to fit you perfectly.&nbsp; You'll have the rest of the peloton envious of your ride.</p> <p class="product-promo-text"><span class="product-promo-header">FREE US shipping over $100!</span><span class="product-promo-body">Orders within next 2 days will be shipped on Monday</span></p> 4779.00000000 362M 6207 Ferrequipo fore-cr5-sram-red 323/362 D