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

Query time 0.00109

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "2.89"
    },
    "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.85",
            "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.28",
            "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.89",
            "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
1680 en <p></p> <p><b>I love my job of being a Wife and a Mommy!</b></p> <p>I have been blessed with a wonderful husband and two handsome&nbsp;boys and a cute little girl. I am learning that the longer I’m married, the more I fall in love with my husband. He truly is a blessing in my life.</p> <p>I enjoy cooking, crocheting, sewing, knitting, reading and even some digital designing.</p> <p><i>I keep busy being a wife, mommy, homeschooling, and operating JulsSweetDesigns & JulsSweetCuts, but I’m thankful for every minute.</i></p> <p><i>God has blessed me with a great family and the passion and enjoyment to make/sew/design items not only for my family but also for others.</i></p> <p><span style="color: rgb(34, 34, 34); font-size: 24px; font-weight: 700;">Returns & exchanges</span></p> <h6>I gladly accept cancellations</h6> <p>Request a cancellation within: 2 hours of purchase</p> <h6>I don't accept returns or exchanges</h6> <p>But please contact me if you have any problems with your order.</p> <h4></h4> <h5>Frequently asked questions</h5> <h6>Return and Exchange Details - Shop policies</h6> <p>All items are sold as-is, no refunds or returns. If there is any problem with your order, I will be happy to work with each individual buyer.<br><br>Custom Orders: Once purchased all sales are FINAL. Custom order items may not be canceled.</p> <h6>Where's my Personalization Proof? - Shop policies</h6> <p>A proof will be sent to you via email for the personalized products you've purchased. Proofs will be sent within 48 BUSINESS hours after payment is cleared.<br><br>Only once you approve the design(s) will the order be printed. Because the products are approved, by you, and are personalized for you, no refunds will be granted AFTER the first proof is sent.</p> <h6>What happens to unapproved proofs? - Shop policies</h6> <p>Unapproved Proofs:<br><br>After I have sent the 1st proof and if you do not reply back, I will send several reminder messages to check in on you.<br><br>After 1 month, and if you have not responded back, I will automatically COMPLETE your order. Your order will be marked as shipped. You will receive a shipping notice that will have a note saying you need to approve your design if you would like to have your item finished and shipped. I will not send any more reminders after this.<br><br>Once you approve your design, I will ship your item posted in my turn around time.</p> <h6>What are your Business Hours?</h6> <p>BUSINESS HOURS:<br>Monday – Friday (working hours vary due to life with 3 kids, and homeschooling)<br><br>*I will be closed on holidays<br><br>If you don't reply to the message or email right away, please don't think I'm ignoring you! I'm problem away from my computer at the moment taking care of my family.<br><br>Don't worry, I will get back to you as soon as I can!</p> <h6>Do you offer a discount?</h6> <p>Yes, I do!<br><br>Please take a look at my welcome message in my shop! I post my most up to date coupon codes there!<br><br>Here's a taste of what you can find in the welcome message!<br><br>Sign up for mailing list and receive a 20% Off Coupon and exclusive specials!<br><a href="http://eepurl.com/grKzn9">http://eepurl.com/grKzn9</a><br><br><br><br>Happy Shopping!!</p> <h6>What is the turnaround time?</h6> <p>CURRENT PROOF TURNAROUND TIME: (starts once payment clears)<br>Proofs: up to 48 Business Hours<br>Extra proofs: less than 24 Business Hours<br><br><br>LASER CUT/ENGRAVED Items:<br>All items will be shipped within 3-5 BUSINESS days of order and payment. (If the item is a PERSONALIZED ITEM – Production will start AFTER Proof has been approved.)</p> <h6>Can I use a coupon on a Custom-Designed Item?</h6> <p>Unfortunately, due to the extra time, attention to detail, and dedicated conversation on the design for a custom-designed item, custom-designed items are not eligible for any discounts or coupons.</p> {"tmenu_style":"V","default_colors":"N","link_color":"#278dc3","label_color":"#278dc3","icon_color":"#278dc3","main_btn_color":"#278dc3","branded_text_color":"#278dc3","vbp_1_url":"","vbp_2_url":"","vbp_3_url":"","vba_1_url":"https:\/\/julssweetdesigns.goimagine.com\/index.php?dispatch=products.search&search_performed=Y","vba_2_url":"https:\/\/julssweetdesigns.goimagine.com\/home-decor-en-8\/","vba_3_url":"https:\/\/julssweetdesigns.com\/craft-show-social-media\/"} Juls Sweet Designs 9113 Goods Dam Road Waynesboro A Juls Sweet Designs 9113 Goods Dam Road Waynesboro PA US 17268 julie@julssweetdesigns.com none Y 1611605905 0 3 acct_1CTgbPJrFqfUksSL 379956573352692 72758,60302,60334 UA-150932775-2 Sweetly Designed for You! https://www.facebook.com/JulsSweetDesigns/ https://www.instagram.com/julssweetdesigns/ https://twitter.com/JulsSweetDesign https://www.pinterest.com/julssweetdesigns/ <p>Welcome! Have some sweet fun looking around my shop! You will find a variety of personalized items for yourself or your sweet loved one.<br></p> G-FG3FLPGG47 244617941050773 A N 0 0 0 0 0 S Professional Plan juls-sweet-designs 1680_0