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

Query time 0.00103

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "2.79"
    },
    "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.70",
            "eval_cost": "0.10",
            "prefix_cost": "1.75",
            "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.18",
            "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.79",
            "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
1056 en <p class="text-justify"><span style="color: rgb(54, 96, 146);">First things first, you are probably wondering about the name .. Gobby Brit Designs....</span></p> <p class="text-justify"><span style="color: rgb(54, 96, 146);">It's an English thing (yes, I'm English)&nbsp; The definition of "gobby" is '<em>a <span style="color: rgb(0, 0, 0);">person who talks too loudly in a blunt or opinionated way'</span> </em>and yes, I have been accused of that, a LOT!&nbsp; I have a blog about my time moving to the USA and it was very chatty (and opinionated) so what better name to give it than The Gobby Brit.&nbsp; My business was an extension of that blog and here we are.</span></p> <p class="text-justify"><span style="color: rgb(54, 96, 146);">I've been artsy-fartsy most of my life.&nbsp; I used to love to draw, but then life got in the way, as it usually does.&nbsp;&nbsp;Quite a few years ago I began screen printing shirts for a local motorcycle club and I also added embroidery along the way, I enjoyed it, and still do many orders, but I felt like something was missing.</span></p> <p class="text-justify"><span style="color: rgb(54, 96, 146);">In 2017 we were at a trade show and spotted a company selling "sand carving" equipment and my interest was peaked!&nbsp; We spoke to them for a long time, went to their quick class that day and ended up leaving the show as proud owners of a brand new sand carving system.&nbsp; A month later, we went to their weekend long training, gained our certificates and that, as they say was the beginning of a love affair!&nbsp;&nbsp;</span></p> <p class="text-justify"><span style="color: rgb(54, 96, 146);">We offer custom sandblast engraved mugs, tumblers, glass items and gifts.&nbsp; &nbsp;I can engrave on glass, wood, metal, ceramic - in fact, I've tried my hand at engraving many different substrates and my repertoire is increasing with each item I find I am able to engrave.</span></p> <p class="text-justify"><span style="color: rgb(54, 96, 146);">Custom Orders are very welcome.&nbsp; Please click the "Contact Us" button on any listing.<br><br>Please note all items are made to order so turn around times vary, but I try to get your item to you as soon as possible. If you need something in a particular timeframe, just let me know and I will work with you.</span></p> <p class="text-justify"><span style="color: rgb(54, 96, 146);">If you see something you like, but would like a different color, size or wording, please let me know. Also, if you have a specific personalization in mind , I can work with you on that too!!</span></p> <p class="text-justify"><span style="color: rgb(54, 96, 146);">Please, feel free to reach out via&nbsp;email or the message center with any questions or to request any customization.&nbsp;Thank you so much for your interest in my store.</span></p> <p class="text-justify"><span style="color: rgb(54, 96, 146);">You can find me on: </span></p> <p class="text-justify"><span style="color: rgb(54, 96, 146);">Facebook:&nbsp;<a href="http://www.facebook.com/gobbybritdesigns"><span></span></a><a href="http://www.facebook.com/gobbybritdesigns">www.facebook.com/gobbybritdesi...</a> </span></p> <p class="text-justify"><span style="color: rgb(54, 96, 146);">Instagram @gobbybritdesigns&nbsp; </span></p> <p class="text-justify"><span style="color: rgb(54, 96, 146);"><br></span></p> <p class="text-justify"><span style="color: rgb(54, 96, 146);"><br><br></span><br></p> <h6><span style="text-align: justify; color: rgb(192, 80, 77);"><strong></strong></span></h6> <p class="text-justify"><span style="color: rgb(192, 80, 77);"><strong>Refunds and Exchanges</strong></span></p> <p><span style="color: rgb(31, 73, 125);">Unfortunately, custom orders cannot be returned or exchanged, unless damaged in transit.&nbsp; Therefore, when placing a custom order, please check all spelling, grammar and information before submitting.<br></span></p> <p><span style="color: rgb(31, 73, 125);">If your item arrives damaged, please let us know as soon as possible and provide a photograph of the damage.&nbsp;&nbsp;</span></p> <p class="text-justify"><b><span style="color: rgb(192, 80, 77);"></span></b><b><span style="color: rgb(192, 80, 77);">Custom and Personalized Orders<br></span></b><span style="color: rgb(31, 73, 125);">No problem, I love custom orders!&nbsp; &nbsp;Any item in my store can be customized (maybe with some limits, depending on customization required).&nbsp; &nbsp;Just message me and we can work on a custom order together.</span><b><span style="color: rgb(192, 80, 77);"><br></span></b></p> <p class="text-justify"><b><span style="color: rgb(192, 80, 77);">Shipping<br></span></b><span style="color: rgb(54, 96, 146);">All orders ship USPS First&nbsp;Class or USPS Priority Mail based on weight.</span></p> <p class="text-justify"><b><span style="color: rgb(192, 80, 77);">Processing Time<br></span></b><span style="color: rgb(54, 96, 146);">While I attempt to get your order to you as soon as possible, please remember that all items are made&nbsp;</span><i style="color: rgb(54, 96, 146);">to order</i><span style="color: rgb(54, 96, 146);">.&nbsp; Each item is processed and shipped as the order is processed.&nbsp;</span></p> <p class="text-justify"><span style="color: rgb(54, 96, 146);">However, I always attempt to ship within 5-7 days of receipt of your order.&nbsp; </span></p> <p class="text-justify"><span style="color: rgb(54, 96, 146);">Should you need your item sooner, please send me a message.&nbsp; I will do everything I can to work with you to get you your item on time.</span> </p> <p><br></p> <h6></h6> {"tmenu_style":"H","default_colors":"N","link_color":"#007d89","label_color":"#00a0af","icon_color":"#00a0af","main_btn_color":"#6dd1d6","branded_text_color":"#00a0af","vbp_1_url":"","vbp_2_url":"https:\/\/gobbybritdesigns.com\/holidays-en-3\/mothers-day\/","vbp_3_url":"https:\/\/gobbybritdesigns.goimagine.com\/british-themed\/","vba_1_url":"https:\/\/gobbybritdesigns.com\/british-themed\/king-charles-coronation\/","vba_2_url":"https:\/\/www.facebook.com\/GobbyBritDesigns","vba_3_url":""} GobbyBritDesigns 326 W. 6th Street San Bernardino A GobbyBritDesigns 326 W. 6th Street San Bernardino CA US 92401 thegobbybrit@gmail.com none Y 1597184589 0 a:4:{s:14:"company_fields";a:2:{i:37;s:6:"Sharon";i:38;s:7:"StPeter";}s:15:"admin_firstname";s:6:"Sharon";s:14:"admin_lastname";s:7:"StPeter";s:6:"fields";a:0:{}} 16 acct_1HFUYSAaL5gnP63t 3968503069897193 76646,39555,72838,61918,39546,57184,39567,39557,39547 UA-177104149-1 CTL7GNSSW456J Custom Sandblast Engraved Gifts for All Occasions https://www.facebook.com/GobbyBritDesigns https://instagram.com/gobbybritdesigns https://twitter.com/thegobbybrit https://www.pinterest.com/gobbybritdesigns/_created/ UA-177104149-1 3968503069897193 gobbybritdesigns.com A {"items_per_file":"2500","time_from":"","time_to":""} N 0 0 0 0 0 S Professional Investor gobbybritdesigns 5.0000 1056_25415