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

Query time 0.00103

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "2.81"
    },
    "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.86",
            "eval_cost": "0.10",
            "prefix_cost": "0.96",
            "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.71",
            "eval_cost": "0.10",
            "prefix_cost": "1.77",
            "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.19",
            "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.81",
            "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
148 en <p><strong></strong><span style="color: rgb(95, 73, 122);"><strong></strong></span></p> <p><strong><span style="color: rgb(54, 96, 146);">Little Bit Pets Kids and More started in November 2011.&nbsp; We are a mother/daughter team that offers quality handmade goods.&nbsp; We make pet items, children activities, purses, embroidered items, holiday items, placemats, baby blankets, and more.&nbsp; We do craft shows during the year.&nbsp; We have 5 cats and 2 dogs between us that are rescues.&nbsp; We both enjoy camping and have seasonal sites in beautiful Northern Michigan.&nbsp; &nbsp;&nbsp;</span></strong></p> <p><span style="color: rgb(95, 73, 122);"><strong></strong></span></p> <h4><span style="color: rgb(128, 100, 162);">Color Variations & Processing</span></h4> <ul><li><strong>Due to the nature of handmade items, there may be some variations to each product.&nbsp; Thread and fabric colors differ slightly from what is seen in our pictures.</strong></li><li><strong>Colors can vary slightly from the picture, as the dye process for fabric can differ and each bolt is slightly different in color.</strong></li><li><strong>Our products are handmade and we do not always have product in stock.&nbsp; We have a 3 to 7 day processing time depending on the item and the season (ie, Christmas, Easter, etc).&nbsp; Some holidays might have a longer processing time.&nbsp;</strong></li></ul> <p><span style="color: rgb(128, 100, 162); font-family: inherit; font-size: 16.25px; font-weight: 600;">Returns</span></p> <ul><li><strong>We do accept returns if the product you received from us is defective.&nbsp; We will either send a new item, upon receipt of the defective/damaged item or a full refund.&nbsp; Please contact us within 7 days of delivery.</strong></li><li><strong>If you are unhappy with your purchase for any reason, please contact us so we may assist you within 7 days of receiving your product.&nbsp; Buyer is responsible for return shipping.&nbsp; Original shipping paid will not be included in the refund.&nbsp; Refunds will not be issued until unused item is received back in it's original packaging and condition.</strong></li></ul> <p><span style="color: rgb(128, 100, 162); font-family: inherit; font-size: 16.25px; font-weight: 600;">Cancellations</span><br></p> <ul><li><strong>We do accept cancellations as long as your item you ordered has not been shipped.&nbsp; There are no cancellations on personalized or custom items that have started in production.</strong></li></ul> <h4><span style="color: rgb(128, 100, 162);">Shipping</span></h4> <ul><li><strong>Shipping will be USPS First Class Mail or USPS Priority Mail.&nbsp; Please have a secure area for your delivery as Little Bit Pets Kids and More is not responsible for missing packages after USPS shows it has been delivered.</strong></li><li><strong>Purchases made with free shipping are subject to our normal return policy.&nbsp; In addition, there will be a restocking fee charged equal to the retail rate postage cost set by USPS.</strong></li></ul> <p><br></p> <p><br></p> <p><strong></strong></p> <p><br></p> <p><strong></strong></p> <p><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":""} Little Bit Pets Kids and More 540 Commonwealth Ave Jackson A Little Bit Pets Kids and More 540 Commonwealth Ave Jackson MI US 49202 littlebitpetskids@gmail.com none Y 1584811830 0 a:4:{s:14:"company_fields";a:2:{i:37;s:15:"Tanya & Sabrina";i:38;s:6:"Dayton";}s:15:"admin_firstname";s:15:"Tanya & Sabrina";s:14:"admin_lastname";s:6:"Dayton";s:6:"fields";a:0:{}} 3 acct_16Ydy4C9pvqgzd6L 913407872799329 1879,1830,1930,1929,1925,52636,133680,1895 Items for your furry kids, human kids and everyone else. https://www.facebook.com/LittleBitPetsKids https://www.pinterest.com/LittleBitPetsKidsandMore <p>Welcome to Little Bit Pets Kids and More where you will find quality made items for your furry kids, human kids and everyone else.</p> oauth.blO6EyYKfalkGJkudpKDRsNr6m_dEUow4lYleORg.lmF2Xlqq7C2f5sLRyhHYMLmWwNQLe2RkZLzLMS8J5NI 913407872799329 A N 0 0 0 0 0 S Professional Plan littlebitpetskidsandmore 5.0000 148_585