SELECT 
  products.*, 
  product_descriptions.*, 
  MIN(
    IF(
      product_prices.percentage_discount = 0, 
      product_prices.price, 
      product_prices.price - (
        product_prices.price * product_prices.percentage_discount
      )/ 100
    )
  ) as price, 
  GROUP_CONCAT(
    CASE WHEN (
      products_categories.link_type = 'M'
    ) THEN CONCAT(
      products_categories.category_id, 
      'M'
    ) ELSE products_categories.category_id END 
    ORDER BY 
      categories.storefront_id IN (0, 1) DESC, 
      (
        products_categories.link_type = 'M'
      ) DESC, 
      products_categories.category_position ASC, 
      products_categories.category_id ASC
  ) as category_ids, 
  popularity.total as popularity, 
  company_descr.i18n_company as company_name, 
  cd.terms, 
  seo_names.name as seo_name, 
  seo_names.path as seo_path, 
  company_descriptions.company_description, 
  discussion.type as discussion_type 
FROM 
  products 
  LEFT JOIN product_prices ON product_prices.product_id = products.product_id 
  AND product_prices.lower_limit = 1 
  AND product_prices.usergroup_id IN (0, 0, 1) 
  LEFT JOIN product_descriptions ON product_descriptions.product_id = products.product_id 
  AND product_descriptions.lang_code = 'en' 
  LEFT JOIN company_descriptions as company_descr ON company_descr.company_id = products.company_id 
  AND company_descr.lang_code = 'en' 
  LEFT JOIN companies as companies ON companies.company_id = products.company_id 
  INNER JOIN products_categories ON products_categories.product_id = products.product_id 
  INNER JOIN categories ON categories.category_id = products_categories.category_id 
  AND categories.storefront_id IN (0, 1) 
  AND (
    categories.usergroup_ids = '' 
    OR FIND_IN_SET(0, categories.usergroup_ids) 
    OR FIND_IN_SET(1, categories.usergroup_ids)
  ) 
  AND (
    products.usergroup_ids = '' 
    OR FIND_IN_SET(0, products.usergroup_ids) 
    OR FIND_IN_SET(1, products.usergroup_ids)
  ) 
  AND categories.status IN ('A', 'H') 
  AND products.status IN ('A', 'H') 
  LEFT JOIN product_popularity as popularity ON popularity.product_id = products.product_id 
  LEFT JOIN company_descriptions AS cd ON cd.company_id = products.company_id 
  AND cd.lang_code = 'en' 
  LEFT JOIN seo_names ON seo_names.object_id = 57337 
  AND seo_names.type = 'p' 
  AND seo_names.dispatch = '' 
  AND seo_names.lang_code = 'en' 
  LEFT JOIN company_descriptions AS company_descriptions ON company_descriptions.company_id = products.company_id 
  AND company_descriptions.lang_code = 'en' 
  LEFT JOIN discussion ON discussion.object_id = products.product_id 
  AND discussion.object_type = 'P' 
WHERE 
  products.product_id = 57337 
  AND (
    companies.status IN ('A') 
    OR products.company_id = 0
  ) 
GROUP BY 
  products.product_id

Query time 0.00238

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "7.54"
    },
    "grouping_operation": {
      "using_filesort": false,
      "nested_loop": [
        {
          "table": {
            "table_name": "products",
            "access_type": "const",
            "possible_keys": [
              "PRIMARY",
              "status",
              "idx_company_id",
              "idx_usergroup_ids"
            ],
            "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",
              "weight_lbs",
              "weight_oz",
              "product_tax_code",
              "deleted_at",
              "archived_at",
              "position"
            ]
          }
        },
        {
          "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": "cd",
            "access_type": "const",
            "possible_keys": [
              "PRIMARY"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "company_id",
              "lang_code"
            ],
            "key_length": "10",
            "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.00",
              "data_read_per_join": "1K"
            },
            "used_columns": [
              "company_id",
              "lang_code",
              "terms"
            ]
          }
        },
        {
          "table": {
            "table_name": "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.31",
              "eval_cost": "0.10",
              "prefix_cost": "0.41",
              "data_read_per_join": "24"
            },
            "used_columns": [
              "product_id",
              "price",
              "percentage_discount",
              "lower_limit",
              "usergroup_id"
            ],
            "attached_condition": "<if>(is_not_null_compl(product_prices), ((`goimagine`.`product_prices`.`lower_limit` = 1) and (`goimagine`.`product_prices`.`usergroup_id` in (0,0,1))), true)"
          }
        },
        {
          "table": {
            "table_name": "product_descriptions",
            "access_type": "const",
            "possible_keys": [
              "PRIMARY",
              "product_id"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "product_id",
              "lang_code"
            ],
            "key_length": "11",
            "ref": [
              "const",
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 1,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.65",
              "eval_cost": "0.10",
              "prefix_cost": "1.15",
              "data_read_per_join": "5K"
            },
            "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",
              "cls_stop_words",
              "how_its_made",
              "custom_header"
            ]
          }
        },
        {
          "table": {
            "table_name": "company_descr",
            "access_type": "const",
            "possible_keys": [
              "PRIMARY"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "company_id",
              "lang_code"
            ],
            "key_length": "10",
            "ref": [
              "const",
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 1,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.90",
              "eval_cost": "0.10",
              "prefix_cost": "2.15",
              "data_read_per_join": "1K"
            },
            "used_columns": [
              "company_id",
              "lang_code",
              "i18n_company"
            ]
          }
        },
        {
          "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.68",
              "eval_cost": "0.10",
              "prefix_cost": "2.93",
              "data_read_per_join": "14K"
            },
            "used_columns": [
              "company_id",
              "status"
            ],
            "attached_condition": "<if>(found_match(companies), ((`goimagine`.`companies`.`status` = 'A') or false), true)"
          }
        },
        {
          "table": {
            "table_name": "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": 6,
            "rows_produced_per_join": 6,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "1.50",
              "eval_cost": "0.60",
              "prefix_cost": "5.03",
              "data_read_per_join": "96"
            },
            "used_columns": [
              "product_id",
              "category_id",
              "link_type",
              "category_position"
            ]
          }
        },
        {
          "table": {
            "table_name": "categories",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY",
              "c_status",
              "p_category_id"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "category_id"
            ],
            "key_length": "3",
            "ref": [
              "goimagine.products_categories.category_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 0,
            "filtered": "5.00",
            "cost_info": {
              "read_cost": "1.50",
              "eval_cost": "0.03",
              "prefix_cost": "7.13",
              "data_read_per_join": "804"
            },
            "used_columns": [
              "category_id",
              "usergroup_ids",
              "status",
              "storefront_id"
            ],
            "attached_condition": "((`goimagine`.`categories`.`storefront_id` in (0,1)) and ((`goimagine`.`categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`goimagine`.`categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`goimagine`.`categories`.`usergroup_ids`))) and (`goimagine`.`categories`.`status` in ('A','H')))"
          }
        },
        {
          "table": {
            "table_name": "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.25",
              "eval_cost": "0.03",
              "prefix_cost": "7.41",
              "data_read_per_join": "520"
            },
            "used_columns": [
              "name",
              "object_id",
              "type",
              "dispatch",
              "path",
              "lang_code"
            ]
          }
        },
        {
          "table": {
            "table_name": "company_descriptions",
            "access_type": "const",
            "possible_keys": [
              "PRIMARY"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "company_id",
              "lang_code"
            ],
            "key_length": "10",
            "ref": [
              "const",
              "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": "7.48",
              "data_read_per_join": "532"
            },
            "used_columns": [
              "company_id",
              "lang_code",
              "company_description"
            ]
          }
        },
        {
          "table": {
            "table_name": "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.03",
              "eval_cost": "0.03",
              "prefix_cost": "7.54",
              "data_read_per_join": "7"
            },
            "used_columns": [
              "object_id",
              "object_type",
              "type"
            ]
          }
        }
      ]
    }
  }
}

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 weight_lbs weight_oz product_tax_code deleted_at archived_at position lang_code product shortname short_description full_description meta_keywords meta_description search_words page_title age_warning_message promo_text cls_stop_words how_its_made custom_header price category_ids popularity company_name terms seo_name seo_path company_description discussion_type
57337 10-sloth P A 66 19.95 5 0.020 0 0 0 0.00 0 1609974386 1678065639 0 N N N B Y R N N N Y 10 1609909200 N 0 0 0 0 N 0 P F 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.000 0.000 2147483647 en Silver Sloth Necklace on Leather <p>Adorable, lazy sloth charm hangs on a leather cord necklace. Individually hand made in your choice of colors, mint, tan or black and lengths from 13 to 20 inches.</p> <p>Adorable, lazy sloth charm hangs on a leather cord necklace. Individually hand made in your choice of length and color.&nbsp;</p> <p>Sloth charm made of lead Free Nickel Free Zinc Alloy Metal - approx. 1 inch x 1 inch and hangs on a decorative sliding bail with a total drop length of 1.75 inches ( 4.5 cm)<br></p> <p><br>Leather cord necklace closes with a silver tone lobster claw clasp and comes in your choice of Natural tan, Mint green or Black. Available in lengths from 14 to 18 inches long. Custom lengths available, just message me for your perfect size.</p> <p><br></p> <p>Sloths are the nature's slowest animal and arguably one of the cutest. These necklaces would make a great gift for your favorite sloth lover.<br></p> <p>Comes gift boxed and ready share.</p> <p><br></p> <p><br></p> sloth pendant necklace, silver sloth, sloth jewelry, womens sloth necklace, womens gift, sloth lover, Adorable, lazy sloth charm hangs on a leather cord necklace. Individually hand made in your choice of colors, mint, tan or black and lengths from 13 to 20 inches. sloth jewelry, sloth necklace, sloth pendant, sloth gifts, lazy animal, silver sloth, leather cord, leather necklaces, green leather, tan leather, black leather, animal jewelry, animal necklace Silver Sloth Necklace on Leather <p>Free shipping with USPS first class mail.&nbsp;</p> <p>Normally ships out in 1 to 2 days.</p> <p>USPS Priority also available.</p> <p>Each necklace is individually made with quality leather and findings. You can choose the color of leather and your favorite length.</p> 19.95000000 134M,137,1176,1164,1168,1302 1848 BitsofftheBeach <h4>Welcome to Bits off the Beach!</h4> <p><span style="color: inherit; font-family: inherit; font-weight: 600;">Returns and exchanges</span><br></p> <p>I gladly accept returns, exchanges, and cancellations&nbsp;</p> <p>• Contact me within 7 days of delivery.</p> <p>• Ship items back with 14 days of delivery.</p> <p>• Request a cancellation before item has been shipped.</p> <p><br></p> <h5>Returns and exchange details&nbsp;</h5> <p>&nbsp;What To Do If Things Go Wrong?&nbsp;</p> <p>&nbsp;I want you to be comfortable shopping with me. Please let me know if you aren't 100% in love with your new purchase. It can be returned in its original condition for 14 days after delivery for a full refund. Your piece of jewelry is guaranteed against breaking for any reason for 60 days from date of delivery! I am happy to repair it and return it to you or to give you an in-shop credit for the purchase price. Return shipping to me will be your responsibility, I will pay for shipping back to you.<br></p> <p>Items lost in the mail will be replaced once we both have exhausted all avenues to try and find where it went. It often is just as simple as checking that the neighbor didn't get it or the mailman didn't stashed it in the bushes for "safe keeping"! I do ship with delivery confirmation and tracking for your comfort and security in knowing what's up during shipping.<br></p> <p>If there is a problem with your purchase, as each item is individually made and often are unique pieces, I can only replace with as close a match as possible of an equivalent item or a refund. Hopefully, none of that will be needed, but it's nice to know that I am on your side if it becomes necessary. Thanks for shopping with me!<br></p> <h5><strong>Shipping</strong></h5> <p>How Do I Get It?</p> <p>I normally send out your item within 1 to 2 business day unless otherwise noted. First class USPS with tracking and confirmation. You may also choose US Priority, a shipping up-grade, under the shipping options on most listings for delivery within the U.S.</p> <p><br></p> <p>Please double-check that you have the correct address listed on your purchase order. If it is returned as undeliverable after being sent, I can not refund the shipping fee. To re-send there will be a minimum charge of 3.00 shipping charge, depending on the weight and location of your purchase.</p> <p><br></p> <p></p> <h5><strong>Additional&nbsp; FAQs</strong></h5> <p>Don't See What You Need?</p> <p>Custom orders are welcome. If you have a special item you would like to be made into something you can wear, let me know what you have in mind and we can work together to see what we can come up with. To place a custom order, contact me by message or email, we can agree on the item to be produced and a listing is made with the link sent by message. Next you need to make the purchase in the normal way, and upon payment being received, the order will be processed and mailed. You will be notified at the point of posting.<br>Purchase and payment must be made within 3 days or your item will be open to buy to the general public.</p> <p></p> <h6></h6> <p><b class="btn btn-link prompt no-wrap ml-xs-1 text-link-primary" style="margin-left: 6px; border-radius: 3px; border-width: initial; border-style: none; border-color: initial; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; padding: 0px; text-decoration-line: underline; user-select: none; white-space: nowrap; -webkit-tap-highlight-color: transparent; -webkit-appearance: none; background-color: transparent; color: rgb(34, 34, 34);"><br></b></p> <p><b class="btn btn-link prompt no-wrap ml-xs-1 text-link-primary" style="margin-left: 6px; border-radius: 3px; border-width: initial; border-style: none; border-color: initial; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; padding: 0px; text-decoration-line: underline; user-select: none; white-space: nowrap; -webkit-tap-highlight-color: transparent; -webkit-appearance: none; background-color: transparent; color: rgb(34, 34, 34);"><br></b></p> <p><b class="btn btn-link prompt no-wrap ml-xs-1 text-link-primary" style="margin-left: 6px; border-radius: 3px; border-width: initial; border-style: none; border-color: initial; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; padding: 0px; text-decoration-line: underline; user-select: none; white-space: nowrap; -webkit-tap-highlight-color: transparent; -webkit-appearance: none; background-color: transparent; color: rgb(34, 34, 34);"><br></b><br></p> <p><b class="btn btn-link prompt no-wrap ml-xs-1 text-link-primary" style="margin-left: 6px; border-radius: 3px; border-width: initial; border-style: none; border-color: initial; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit; padding: 0px; text-decoration-line: underline; user-select: none; white-space: nowrap; -webkit-tap-highlight-color: transparent; -webkit-appearance: none; background-color: transparent; color: rgb(34, 34, 34);"></b></p> silver-sloth-necklace-on-leather 2/13/134 <h4 class="text-center"><strong>Jewelry and Gifts inspired by the Sea&nbsp;</strong></h4> <h4 class="text-center"><strong>Handcrafted Jewelry reminding you of a relaxed and easy day at the beach...</strong></h4> <h4 class="text-center"></h4> <p class="text-center">All the "bits off the beach" bring their own inspirations. The color, texture, size or shape of each piece speaks it's own story. I try to bring each to life in it's own special way for you to enjoy.&nbsp;My favorites are sea glass, shells, beach stones and sea beans.&nbsp; I add quality, modern components to offer everything from pendant necklaces, earrings, anklets and belly rings to book marks and wind chimes.<br></p> <h5 class="text-center"></h5> D