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 = 620 
  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 = 620

Query time 0.00105

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "2.90"
    },
    "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.89",
            "eval_cost": "0.10",
            "prefix_cost": "0.99",
            "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.77",
            "eval_cost": "0.10",
            "prefix_cost": "1.86",
            "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.29",
            "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.91",
            "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
620 en <p><strong><span style="color: rgb(79, 129, 189);">5 Star Etsy Shop for 8 years running.<br></span></strong></p> <p><strong>Welcome to my shop! You'll find beautifully designed jewelry crafted with much love. Hope you find something you really like here.<span style="color: rgb(141, 179, 226);"><br></span></strong><span style="color: rgb(141, 179, 226);"><br></span></p> <ul><li><strong><span style="color: rgb(192, 80, 77);">Personalized Hand Stamped Jewelry Custom Mommy Necklace&nbsp;</span></strong></li><li><strong><span style="color: rgb(192, 80, 77);">Specialized in Nurses Pin / Necklace</span></strong></li></ul> <p></p> <p><strong><span style="color: rgb(141, 179, 226);"><br></span></strong></p> <p><strong><span style="color: rgb(141, 179, 226);"><br></span></strong></p> <p><strong><span style="color: rgb(141, 179, 226);">You can also read all actual customer reviews here:(FIVE STAR)<br></span></strong><span style="font-family: -apple-system, BlinkMacSystemFont, &quot;San Francisco&quot;, Roboto, &quot;Segoe UI&quot;, Ubuntu, &quot;Helvetica Neue&quot;, sans-serif;">1,here is my other 2 shops link for you to read feedbacks/ Reviews so you can get confident&nbsp;</span><span style="font-family: -apple-system, BlinkMacSystemFont, &quot;San Francisco&quot;, Roboto, &quot;Segoe UI&quot;, Ubuntu, &quot;Helvetica Neue&quot;, sans-serif;"></span></p> <p><a href="https://www.etsy.com/shop/Jewelry4NursesByAshi#reviews" target="_blank">https://www.etsy.com/shop/Jewelry4NursesByAshi#reviews</a><br></p> <p><br></p> <p><br>2,here is my other 2 shops link for you to read feedbacks/ Reviews so you can get confident&nbsp;<br></p> <p><a href="https://www.etsy.com/shop/ashijewelers#reviews">https://www.etsy.com/shop/ashijewelers#reviews</a><br></p> <p></p> <p><span style="color: rgb(84, 141, 212);">→ CONNECT WITH ME ←<br></span><br>Facebook Fan Page, be sure to like my shop to be the first to know about coupon codes and new pieces:<br>✓ Like this shop on Facebook: <a href="http://www.facebook.com/ashijeweler">www.facebook.com/ashijeweler</a><br><br>✓ Follow this shop on Pinterest: <a href="https://www.pinterest.com/ashijewelers">https://www.pinterest.com/ashi...</a><strong></strong></p> <p><br></p> <p>Your satisfaction is my top priority. if you have any questions just send me a convo.<br><br>Let me know if you need to make your necklace longer or shorter (up to 20" for no additional charge). please leave your choice at the checkout.<br>or If you see any item in my shop you would like customized, please send me a convo.<br><br><br><br>Please note: my jewelry has small parts and is not intended for small children or babies who may put pieces in their mouth, as it could be a hazard. Safety first:) Customers assume full liability for any jewelry purchased.</p> <p>Welcome to my shop! You'll find beautifully designed jewelry crafted with much love. Hope you find something you really like here.<br><br>The order is sent as a gift. There is no invoice inside the package. If you need each of your items to be packed separately, please leave me a note at check out.<br><br>Your satisfaction is my top priority. if you have any questions just send me a convo.<br><br>Let me know if you need to make your necklace longer or shorter (up to 20" for no additional charge). please leave your choice at the checkout.<br>or If you see any item in my shop you would like customized, please send me a convo.<br><br></p> <h3>Shipping</h3> <p>Processing time<br>The time I need to prepare an order for shipping varies. For details, see individual items.</p> <p><br>Customs and import taxes<br>Buyers are responsible for any customs and import taxes that may apply. I'm not responsible for delays due to customs.</p> <p><br></p> <p><br></p> <h3>Returns & exchanges</h3> <p><br></p> <h6>I gladly accept returns and exchanges</h6> <p>Contact me within:&nbsp;<span class="text-gray-darker">3 days of delivery</span><br>Ship items back within:&nbsp;<span class="text-gray-darker">7 days of delivery</span></p> <h6>I don't accept cancellations</h6> <p>But please contact me if you have any problems with your order.</p> <h6></h6> <h6>The following items can't be returned or exchanged</h6> <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></ul> <p><br></p> <p><strong>Conditions of return<br></strong>Buyers are responsible for return shipping costs. If the item is not returned in its original condition, the buyer is responsible for any loss in value.</p> <p><br></p> <h6>Stolen Packages/Lost Packages</h6> <p>I am not responsible for theft of any packages. I am not responsible for wrong addresses. I will ship your package to the address you have on file at the time you signed up. It is your responsibility to keep your address updated when you move. Packages that show delivered or may be stolen from your mailbox or delivery area are not my responsibility. If a package shows that it was delivered you will need to take it up with your local post office for that area as they can tell you by GPS where they left your package.</p> <p><br></p> <p><br></p> <p>&nbsp;AshiJewelersLLC. All creations, designs, handmade charms, photos, and item descriptions & title verbiage are copyright protected and property of The Ashi Jewelers. *Photos may not be used without permission of the Designer/Artist/Creator of The Ashi Jewelers.<br><br><br><br><br><strong>Please note</strong>:&nbsp;</p> <p>my jewelry has small parts and is not intended for small children or babies who may put pieces in their mouth, as it could be a hazard. Safety first:) and same for all Healthcare Professionals we do not recommend wearing these items while you at work and will NOT be responsible for loose pieces or broken jewelry while you deal with patients. Customers assume full liability for any jewelry purchased.<br></p> {"tmenu_style":"V","default_colors":"N","link_color":"#007d89","label_color":"#007377","icon_color":"#007377","main_btn_color":"#6dd1d6","branded_text_color":"#007377","vbp_1_url":"","vbp_2_url":"","vbp_3_url":"","vba_1_url":"","vba_2_url":"","vba_3_url":""} Ashi Jewelers LLC 800 Hunters Gln Murphy A Ashi Jewelers LLC 800 Hunters Gln Murphy TX US 75094 ashijewelersllc@gmail.com none Y 1589947543 0 a:4:{s:14:"company_fields";a:2:{i:37;s:6:"Vandna";i:38;s:8:"Bhikadia";}s:15:"admin_firstname";s:6:"Vandna";s:14:"admin_lastname";s:8:"Bhikadia";s:6:"fields";a:0:{}} 4 acct_1GmVzZCHQ7vo88v2 https://www.facebook.com/AshiJ https://www.facebook.com/AshiJ A {"items_per_file":"2500","time_from":"","time_to":""} N 0 0 0 0 0 S All-Star Plan ashi-jewelers-llc 5.0000 620_8883