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

Query time 0.00111

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "2.57"
    },
    "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.76",
            "eval_cost": "0.10",
            "prefix_cost": "0.86",
            "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.58",
            "eval_cost": "0.10",
            "prefix_cost": "1.53",
            "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": "1.96",
            "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.57",
            "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
75 en <figure><strong><img src="https://d1q8o8ch5u48ua.cloudfront.net/images/companies/75/Screenshot%20(29).png?1588142088132"></strong></figure> <p>Hey there! I'm Shannon and I resin all the things! In 2020 I added sublimation equipment to my studio. I’ll be adding more products from that project soon! Come say hi on&nbsp;<a href="http://www.instagram.com/joyinthemaking.art" target="_blank">Instagram</a>&nbsp;or <a href="http://www.facebook.com/joyinthemaking.art" target="_blank">Facebook!</a></p> <p><em>We are a family business and you are an extension of this family. We appreciate you and look forward to sharing some JOY with you!</em><br></p> <p>When I'm not in my studio making pretty things for your home, I'm being a wife (30 years whoop whoop!) and a mom to five grown kids who still manage to keep me busy, and I love it! Our 22 year old was born with part of her brain missing, and I am also her full time caregiver.&nbsp;<br></p> <p>In 2018 my husband beat cancer. That's the year I realized I needed an outlet. My kids were slowly leaving home to be independent, and as a caregiver, I rarely took time to enjoy something just for me. At the same time, cancer isn't cheap! Our savings shrunk and I wanted to help recoup some of that. As a result, Joy in the Making was born!</p> <p>As retirement years grow closer, we are gearing up for traveling and taking our products on the road to shows around the country. We both love doing events and combining that with traveling sounds amazing to us!&nbsp;</p> <p>Have a blessed day and feel free to message me if you have any questions about our products, or us.&nbsp;</p> <p>Thank you for stopping by my little corner of the Caring Community!</p> <p>My products are handmade and/or upcycled. I have a studio detached from my home where I do most of my work. See my shop description for more about me.&nbsp;&nbsp;<br></p> <p><strong>Shipping:</strong>&nbsp;</p> <p>Please know I recycle as much as I&nbsp;can, including boxes, so you may see tale tale signs of that. Rest assured, I am quite skilled at rebuilding secure boxes to fit your item.&nbsp;<br></p> <p>I will send you a tracking number.</p> <p>I cannot control the delivery company once they have your package. If there is an issue with your package once it is shipped, please contact me and we will work to resolve the issue.&nbsp;</p> <p>If you are unhappy with your item, please reach out to me and we can discuss how to make it right.&nbsp;<br></p> <p><strong>Returns</strong>: I do not typically accept returns. If there is something you’re not happy with, please message me to discuss.&nbsp;<br></p> <p>For custom orders, I send photos of items prior to shipping for final approval and to be sure it is what you’re expecting. I do not do this for listed items, as photos are included in the listing. If you have questions, please contact me prior to purchase.&nbsp;</p> <p><strong>Please remember</strong> there are color differences on screens, and I am not responsible for those differences.<br></p> <p>If you are ordering a custom item, &nbsp;I ask a lot of questions in order to be sure I match your idea the best I&nbsp;can. Therefore, it is very important that you keep tabs on your email or conversations through Goimagine so you can answer my questions in a timely manner. I will wait 24 hours, then make a decision based on what information I do have.&nbsp;</p> <p><strong>Regarding mugs:</strong> I do not use vinyl on my mugs. They are dishwasher safe, but handwashing is recommended. If you use a water softener such as vinegar, your design might fade a bit, so handwashing is strongly encouraged.&nbsp;</p> <p><b>Regarding RESIN work:&nbsp;</b><br>Resin work is incredibly fluid and no two pieces will look identical. For custom orders, if I send proofs during the process, or when an item is complete, and you approve it, there will be no revisions or return.&nbsp;</p> <p>I have a professional studio, including a sealed curing cabinet and air extraction system. &nbsp;Sometimes a rogue piece of dust will settle into your resin. Please see this as a reminder that you supported a handmade business.If you're concerned about this, please contact me and for more detailed photos.&nbsp; <br><br>Please note, if you have asked me to replicate a previously made piece of mine, &nbsp;I will do the best I can, but it is impossible to have an exact replica. I mix colors for each project, so even those will vary.</p> <p>I support other makers and will not copy their work. If you see a style you like, please submit three or four variations and we can use them as inspiration to design your own unique piece.&nbsp;</p><p>I look forward to working with you on a project you’ll enjoy for years to come!</p> {"tmenu_style":"V","default_colors":"N","link_color":"#5b1689","label_color":"#bb6a6a","icon_color":"#38761d","main_btn_color":"#6dd1d6","branded_text_color":"#12839d","vbp_1_url":"","vbp_2_url":"","vbp_3_url":"","vba_1_url":"","vba_2_url":"","vba_3_url":""} Joy in the Making 1624 W. Ave. L-4 Lancaster A Joy in the Making 1624 W. Ave. L-4 Lancaster CA US 93534 Joyinthemaking7@gmail.com none Y 1584496838 73 a:4:{s:14:"company_fields";a:2:{i:37;s:8:"Shannon ";i:38;s:10:"Santamaria";}s:15:"admin_firstname";s:8:"Shannon ";s:14:"admin_lastname";s:10:"Santamaria";s:6:"fields";a:0:{}} 3 acct_1GMSMIFHORRWd0of 21053,18901,158070,61025 UA-177235222-1 UA-177235222-1 joyinthemakingart.com A {"items_per_file":"2500","time_from":"","time_to":""} N 0 0 0 0 0 S Professional Plan joyinthemaking 5.0000 75_476