SELECT 
  company_descriptions.*, 
  companies.*, 
  vendor_plan_descriptions.plan, 
  seo_names.name as seo_name, 
  seo_names.path as seo_path, 
  vendor_ga_tracking_code, 
  vendor_fb_tracking_code, 
  AVG(discussion_rating.rating_value) AS average_rating, 
  CONCAT(
    companies.company_id, 
    '_', 
    IF (
      discussion_rating.thread_id, discussion_rating.thread_id, 
      '0'
    )
  ) AS company_thread_ids 
FROM 
  companies AS companies 
  LEFT JOIN company_descriptions AS company_descriptions ON company_descriptions.company_id = companies.company_id 
  AND company_descriptions.lang_code = 'en' 
  LEFT JOIN vendor_plan_descriptions ON companies.plan_id = vendor_plan_descriptions.plan_id 
  AND vendor_plan_descriptions.lang_code = 'en' 
  LEFT JOIN seo_names ON seo_names.object_id = 1738 
  AND seo_names.type = 'm' 
  AND seo_names.dispatch = '' 
  AND seo_names.lang_code = 'en' 
  LEFT JOIN discussion as discussionA ON discussionA.object_id = companies.company_id 
  AND discussionA.object_type = 'M' 
  LEFT JOIN discussion_posts ON discussion_posts.thread_id = discussionA.thread_id 
  AND discussion_posts.status = 'A' 
  LEFT JOIN discussion_rating ON discussionA.thread_id = discussion_rating.thread_id 
  AND discussion_rating.post_id = discussion_posts.post_id 
WHERE 
  companies.company_id = 1738

Query time 0.00107

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "2.76"
    },
    "nested_loop": [
      {
        "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.00",
            "data_read_per_join": "14K"
          },
          "used_columns": [
            "company_id",
            "status",
            "company",
            "lang_code",
            "address",
            "city",
            "state",
            "country",
            "zipcode",
            "email",
            "phone",
            "url",
            "storefront",
            "secure_storefront",
            "entry_page",
            "redirect_customer",
            "countries_list",
            "timestamp",
            "shippings",
            "logos",
            "request_user_id",
            "request_account_name",
            "request_account_data",
            "plan_id",
            "stripe_connect_account_id",
            "identifier_facebook_pixel",
            "featured_products",
            "sd_ga_tracking_code",
            "paypal_commerce_platform_account_id",
            "tagline",
            "url_facebook",
            "url_instagram",
            "url_twitter",
            "url_pinterest",
            "announcement",
            "shippo_api_token",
            "shippo_carrier",
            "shippo_service_type",
            "vendor_ga_tracking_code",
            "vendor_fb_tracking_code",
            "custom_domain",
            "custom_domain_status",
            "taxjar_key",
            "taxjar_export_statuses",
            "taxjar_export_csv_data",
            "ag_hide_city",
            "updated_timestamp",
            "suspend_date",
            "grace_period_start",
            "last_time_suspended",
            "last_debt_notification_time",
            "tax_number",
            "stripe_connect_account_type",
            "registered_from_storefront_id"
          ]
        }
      },
      {
        "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": 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",
            "company_description",
            "terms",
            "subdomain_colors",
            "i18n_company",
            "i18n_address",
            "i18n_city"
          ]
        }
      },
      {
        "table": {
          "table_name": "vendor_plan_descriptions",
          "access_type": "const",
          "possible_keys": [
            "PRIMARY"
          ],
          "key": "PRIMARY",
          "used_key_parts": [
            "plan_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": [
            "plan_id",
            "lang_code",
            "plan"
          ]
        }
      },
      {
        "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": 1,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "0.85",
            "eval_cost": "0.10",
            "prefix_cost": "0.95",
            "data_read_per_join": "1K"
          },
          "used_columns": [
            "name",
            "object_id",
            "type",
            "dispatch",
            "path",
            "lang_code"
          ]
        }
      },
      {
        "table": {
          "table_name": "discussionA",
          "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": 1,
          "filtered": "100.00",
          "using_index": true,
          "cost_info": {
            "read_cost": "0.67",
            "eval_cost": "0.10",
            "prefix_cost": "1.72",
            "data_read_per_join": "24"
          },
          "used_columns": [
            "thread_id",
            "object_id",
            "object_type"
          ]
        }
      },
      {
        "table": {
          "table_name": "discussion_posts",
          "access_type": "ref",
          "possible_keys": [
            "thread_id",
            "thread_id_2"
          ],
          "key": "thread_id_2",
          "used_key_parts": [
            "thread_id",
            "status"
          ],
          "key_length": "6",
          "ref": [
            "goimagine.discussionA.thread_id",
            "const"
          ],
          "rows_examined_per_scan": 1,
          "rows_produced_per_join": 1,
          "filtered": "100.00",
          "using_index": true,
          "cost_info": {
            "read_cost": "0.25",
            "eval_cost": "0.18",
            "prefix_cost": "2.15",
            "data_read_per_join": "787"
          },
          "used_columns": [
            "post_id",
            "thread_id",
            "status"
          ]
        }
      },
      {
        "table": {
          "table_name": "discussion_rating",
          "access_type": "eq_ref",
          "possible_keys": [
            "PRIMARY",
            "thread_id"
          ],
          "key": "PRIMARY",
          "used_key_parts": [
            "post_id"
          ],
          "key_length": "3",
          "ref": [
            "goimagine.discussion_posts.post_id"
          ],
          "rows_examined_per_scan": 1,
          "rows_produced_per_join": 1,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "0.44",
            "eval_cost": "0.18",
            "prefix_cost": "2.76",
            "data_read_per_join": "28"
          },
          "used_columns": [
            "rating_value",
            "post_id",
            "thread_id"
          ],
          "attached_condition": "<if>(is_not_null_compl(discussion_rating), (`goimagine`.`discussion_rating`.`thread_id` = `goimagine`.`discussionA`.`thread_id`), true)"
        }
      }
    ]
  }
}

Result

company_id lang_code company_description terms subdomain_colors i18n_company i18n_address i18n_city status company address city state country zipcode email phone url storefront secure_storefront entry_page redirect_customer countries_list timestamp shippings logos request_user_id request_account_name request_account_data plan_id stripe_connect_account_id identifier_facebook_pixel featured_products sd_ga_tracking_code paypal_commerce_platform_account_id tagline url_facebook url_instagram url_twitter url_pinterest announcement shippo_api_token shippo_carrier shippo_service_type vendor_ga_tracking_code vendor_fb_tracking_code custom_domain custom_domain_status taxjar_key taxjar_export_statuses taxjar_export_csv_data ag_hide_city updated_timestamp suspend_date grace_period_start last_time_suspended last_debt_notification_time tax_number stripe_connect_account_type registered_from_storefront_id plan seo_name seo_path average_rating company_thread_ids
1738 en <p>My Story</p> <p><span class="mt-xs-1" data-inplace-editable-text="story" data-endpoint="AboutPost" data-key="story" data-placeholder="How did you get started? What inspires you? We know each seller’s story is unique&mdash;tell yours here.">I spent my entire life watching my mom create beautiful things, from paintings, jewelry, glass beads, photographs, paper crafts, and the list goes on and on. She would always try to get me interested in creating things but I would always say "Mom I'm not crafty like you".</span></p> <p><span class="mt-xs-1" data-inplace-editable-text="story" data-endpoint="AboutPost" data-key="story" data-placeholder="How did you get started? What inspires you? We know each seller’s story is unique&mdash;tell yours here.">Well that changed in 2015 when I sustained a thumb and hand injury to my dominant hand. I underwent seven surgeries in order to regain full use of my thumb. Unfortunately I was unable to regain full use of my thumb which sent me into a depression. I had to find an escape from the depression and I ended up finding small things that I could create with minimal use of my thumb. Creating things ended up becoming therapeutic for me. It allowed me to work on using my thumb in ways that I hadn't had to do previously. Fine motor skills were extremely hard for me but with repetition they started getting better but will never be 100% again. The injury forced me to find new ways of doing things and I'm honestly very thankful because if it hadn't of been for the injury I would of never begun creating and I can't imagine my life without that outlet now.&nbsp;</span></p> <p>I've never been into a craft store that I didn't love and I've never seen a craft that I didn't want to try and recreate or make my own. I know quite ironic since my entire life was spent going to the dreaded craft stores with my mom. I can now say that I'm definitely my mother's daughter.&nbsp;</p> <p>My mom is my biggest inspiration I'm always in pure amazement of everything she creates. She's taught me to never give up and always have faith in myself and my creations. My husband is my biggest supporter. If it hadn't of been for him always encouraging and supporting me I don't know where I would be right now.&nbsp;</p> <p>I'm a perfectionist by fault and never think anything I create is good enough to show or sell to others. It's taken me a long time to get up the nerve to show others my creations.</p> <p>I truly hope everything you purchase from my store brings you as much happiness as it brought me when I created it.</p> <p>In crafting there are no mistakes. It's your own unique creation.</p> <p>- Stormie Gale Creates</p> <p><span class="mt-xs-1" data-inplace-editable-text="story" data-endpoint="AboutPost" data-key="story" data-placeholder="How did you get started? What inspires you? We know each seller’s story is unique&mdash;tell yours here."><br></span></p> <p></p> <p><b><span style="color: rgb(0, 0, 0);">WELCOME TO STORMIE GALE CREATES!</span></b></p> <hr> <p><b>I GLADLY ACCEPT RETURNS AND CANCELLATIONS</b></p> <p>Contact me within: 3 days after delivery.</p> <p>Ship items back within: 7 days after delivery. </p> <p>Request a cancellation within: 1 hour after purchase. </p> <hr> <p><b>I'M SORRY I DON'T ACCEPT EXCHANGES</b></p> <p>Please contact me if you have any problems with your order.</p> <hr> <p><b>THE FOLLOWING ITEMS CAN'T BE RETURNED</b></p> <p>Because of the nature of these items, unless they arrive damaged or defective, I can't accept returns for: </p> <ul><li>Custom or personalized orders </li><li>Perishable products (like food or flowers) </li><li>Digital downloads </li><li>Intimate items (for health/hygiene reasons) </li><li>Items on sale </li><li>Small imperfections in items which is due to each item being handcrafted</li></ul> <hr> <p><b>RETURN DETAILS</b>&nbsp;<br></p> <p>&nbsp;All returns are at your expense and must be shipped within 7 days of receipt. Once I receive the item in original condition, I will send you a prompt refund to the account you used to purchase the item. I will cancel the transaction and no feedback will be left on either side.</p> <hr> <p><b>PAYMENT DETAILS</b></p> <p>I'm pleased to accept Visa, MasterCard, Maestro, American Express, JBC, Discover, Diners Club, Union Pay, Google Pay, Apple Pay, Pay Pal. Sales tax is collected. Payment is due upon placing your order. If payment is not received within 24 hours, I will contact you via email as a reminder. However, if payment has not been received within 24 hours of email, the order will be canceled.</p> <p>Orders are processed within 1 business day after payment is received. </p> <hr> <p><b>SHIPPING DETAILS</b></p> <p>I only offer Priority Mail shipping through the USPS which protects me and you. Priority Mail shipping includes tracking information and up to $50 insurance.<br></p> <p>I can’t be held responsible for orders lost in the mail and will not issue refunds for lost packages. If your package gets lost, you will need to contact the USPS and file a claim with them. I ship all items with tracking info to protect me and you. I would suggest that you add additional insurance to packages for your own protection. Most orders will ship out within 1-3 business days once payment post. If you absolutely need something right away, please let me know and I will try to accommodate.</p> <hr> <p><b>PLEASE DOUBLE CHECK YOUR ADDRESS WHILE CHECKING OUT TO MAKE SURE IT'S UP TO DATE.&nbsp;</b></p> {"tmenu_style":"V","default_colors":"Y","link_color":"#007d89","label_color":"#00a0af","icon_color":"#00a0af","main_btn_color":"#6dd1d6","branded_text_color":"#00a0af","vbp_1_url":"www.StormieGaleCreates.com","vbp_2_url":"","vbp_3_url":"","vba_1_url":"","vba_2_url":"","vba_3_url":""} Stormie Gale Creates 59 Gne Ct W Freeport A Stormie Gale Creates 59 Gne Ct W Freeport FL US 32439-6618 StormieGaleCreates@gmail.com none Y 1613060455 0 4 acct_1IJjSuBuP2wr5dLS 489582215640954 283755,284178,136558,137915,137866,136534,137744,137762,135082,135349,135366,136571,136578,136588,136620,137050,137243,137283,137378 262014359 TXUV4EVEJ4N6Y In crafting there are no mistakes. It's your own unique creation. https://www.facebook.com/stormiegalecreates https://www.instagram.com/stormiegalecreates https://twitter.com/StormieGaleCrea https://www.pinterest.com/StormieGaleCreates <p class="text-center"><span style="color: rgb(0, 0, 0);"><strong><strong><span></span></strong><span></span>Welcome, thank you for stopping by my shop! You will find unique, one-of-a-kind, handcrafted items. I hope the creations listed in my shop bring a smile to your face. Please reach out if you have any questions.</strong><strong>&nbsp;</strong></span></p> oauth.25I_b6aXUp1oNCxSGDnWOCeEQdmbEN5Ee44ZMs52.rqaOTx2CYdT7L_A6-msfS1tGHJZZTVmkNN4mliPKfYg UA-49224675-1 1088089818797412 stormiegalecreates.com A N 0 0 0 0 0 S All-Star Plan www.stormiegalecreates.com 5.0000 1738_345330