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 = 101201 
  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 = 101201 
  AND (
    companies.status IN ('A') 
    OR products.company_id = 0
  ) 
GROUP BY 
  products.product_id

Query time 0.01182

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "5.25"
    },
    "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.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(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.66",
              "eval_cost": "0.10",
              "prefix_cost": "1.11",
              "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.11",
              "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.89",
              "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": 3,
            "rows_produced_per_join": 3,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.75",
              "eval_cost": "0.30",
              "prefix_cost": "3.94",
              "data_read_per_join": "48"
            },
            "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": "0.75",
              "eval_cost": "0.02",
              "prefix_cost": "4.99",
              "data_read_per_join": "402"
            },
            "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.13",
              "eval_cost": "0.02",
              "prefix_cost": "5.14",
              "data_read_per_join": "260"
            },
            "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.05",
              "eval_cost": "0.02",
              "prefix_cost": "5.20",
              "data_read_per_join": "266"
            },
            "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.04",
              "eval_cost": "0.02",
              "prefix_cost": "5.25",
              "data_read_per_join": "3"
            },
            "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
101201 101201 P A 2718 0.00 4 0.250 0 0 0 0.00 0 1626066232 1627962460 0 N N N B N R N N N Y 10 0 S 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 4.000 2147483647 en magnet, natural stone, tumbled tile - lighthouse <p>this is a 2x2 square tumbled tile magnet - hand stamped with a lighthouse and the word inspire.<br>there is a heavy duty magnet on the back.<br></p> <p>Please note - because of the natural "holes" and "patches" in the tile the image may also have blank spots in it -- it is a natural stone with varying degrees of color and texture so, each coaster or magnet is unique -- each design my vary.</p> <p>thanks for stopping by!<br>__________________________________________________________</p> <p>your order will be wrapped with care and shipped via USPS</p> <p>all items are handmade. because of this, no 2 items are exactly the same - that's what makes them unique :)</p> <p><br></p> tile,magnet,gift,teacher,tumbled,home_decor,hand_stamped,quote,natural_stone,inspire,lighthouse <p>This item ships in 3 to 5 days.</p> 5.00000000 2566M,205,5652 1371 serenitylane <p><strong>Processing Time</strong></p> <p>Currently processing time is 3 to 5 business days before your item ships.&nbsp; Most of my items are made-to-order.&nbsp; Any one-of-a-kind items that are already done will ship in 1 to 2 days.</p> <p><strong>Payments</strong><br></p> <p>Payment should be made through Stripe or PayPal, through goimagine's checkout -checks and money orders will not be accepted. <br></p> <p>NY state residents will be charged sales tax</p> <p><strong>Shipping Policies</strong><br><br>Your order will be wrapped with care and shipped via USPS - mostly First Class mail, some are sent Priority Mail. You will receive a tracking/delivery conformation number once your order has shipped.</p> <p>Once the package leaves my hands, I can not be responsible for lost or damaged items. If you have not received your order, please let me know and I'll do what I can to help you track it down. If your item is damaged, please message me and we'll see what we can do to fix it. <br><br></p> <p><strong>Refunds, Exchanges and Cancellations</strong></p> <p>I don't offer refunds, exchanges or cancellations after shipping.&nbsp; If an order needs to be cancelled prior to shipping, please contact me within 12 hours of ordering.<br></p> <p> Please note - all items are handmade. Because of this, no 2 items are exactly the same - that's what makes them unique. Because most of the items are made-to-order, there may be a slight variance in the pictured item, and what you receive.<br></p> <p>Your satisfaction is important to me -- If there is a problem with your order, please contact me directly through a message here, or at serenitylanedesigns@live.com . If an item arrives damaged, please contact me as soon as possible. Please provide any photos.&nbsp; We will work together to resolve and come to a solution.<br></p> <p>I'm sorry, but because of the handmade nature of my items, I do not offer refunds, partial or otherwise, or exchanges.<br></p> <p><strong>Custom Orders</strong></p> <p>I would be happy to help you with a custom order - I love to do them. Please email me, or message me and let me know what you have in mind. I will then contact you to discuss details. </p> <p>Please note -- custom orders are to be paid in full before any work has begun on your item.&nbsp; Depending on your time frame, your order may require a rush fee.&nbsp; Full payment is expected before work begins.<br></p> <p>There are no refunds on custom ordered items. If there is a problem with the order please contact me directly within 3 days of delivery.<br></p> <p>There will be a 50% cancellation fee on custom orders canceled before shipping. <br><br></p><p></p><p><strong>Wholesale&nbsp;</strong> <br></p><p>If you are interested in an item(s) at whole sale, please message me, or send me an email (serenitylanedesigns@live.com) to discuss the details.</p><br><p></p><p><strong>Additional Information</strong><br></p> <p>Items come from a smoke free home.</p> <p>Gift wrapping is available for a small fee - please message me prior to completing your order.</p><p>Please follow me on my social platforms for sales, coupon codes and special items!</p><p><br></p><p>Thanks you so much for supporting me and my small business!</p><p>--diane<br></p><p></p><p><br></p><p><strong></strong><br></p><p><br></p><br><p></p> <p><br></p> <p><br></p> magnet-natural-stone-tumbled-tile-lighthouse 2566 <p>Welcome to Serenity Lane Designs.&nbsp; My name is Diane, and I am the sole-owner and creator behind Serenity Lane.&nbsp; <br></p><p>I have been crafting and creating for easily 20 years.&nbsp; The medium of the projects has changed some over the years, and I like to try new things. I started Serenity Lane officially July 1, 2011, but the idea had always been in my head.&nbsp; We used to live on a road called Serenity Lane, and I always thought that was such a quaint and cute name.&nbsp; As I mentioned, I've always loved to craft, but while living in that house, my love for rubber stamps began.<br><br>I began making handmade cards, and scrapbook pages.&nbsp; Eventually I began stamping other items, like tiles and candles.&nbsp; I also love to craft with papers, and a few years ago my husband bought me a Cricut for Christmas and my love for vinyl and more paper crafts took off from there. <br><br> </p><p>Many people have asked me how I came up with the name - Serenity Lane, and the significance of the pink Gerber daisy.<br></p><p>The pink Gerber daisy has a special meaning for me.&nbsp; In the spring of 2010 I was asked to lead a women's spiritual life retreat.&nbsp; The theme I choose was "No One Can Take Away Your Joy".&nbsp; In doing research for the retreat, I learned that the Gerber daisy symbolizes cheerfulness and joy, and the color pink symbolizes - in the Christian sense, joy and happiness.&nbsp; I adopted these symbols and used them in the retreat.&nbsp; My mom went on this retreat with me, and a week after the retreat she got very ill. She spent 2 months in and out of ICU, and we were told her disease - Scleroderma, was finally going to win her almost 30 year battle.&nbsp; My mom passed away 6 months later.&nbsp; Mom and I were close - I "dragged" her off to retreats and outings, shopping and adventures all of the time.&nbsp; The one I led was our last "outing" together. The scripture I focused on for the retreat took on new meaning for me (John 16:22 ~ Now is your time of grief, but I will see you again and you will rejoice, and no one will take away your joy.).&nbsp; The pink Gerber daisy symbolizes many things for me - the joy and happiness crafting brings me, and a special way to remember my mom, and knowing she would love that I've stepped out and started this new adventure.</p> <p>So -- welcome to Serenity Lane Designs!&nbsp; There are so many things for you to check out.&nbsp; I love to do custom orders, so please feel free to drop me a note and ask for a custom order.</p> <p>I've also had the honor of appearing on ABC's The Chew.&nbsp; It was an exciting adventure for me.&nbsp; I was able to craft with the hosts -- you can check out the story, pictures, and more on my <a href="http://serenitylanedesigns.com/blog" target="_blank">blog</a> if you'd like.</p> <p>Thank you so much for taking the time to read my creative journey's story - and remember . . .no one can take away your joy!</p><p><br></p><p>--diane<br></p><p></p> D