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

Query time 0.00207

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
105 en <p>Welcome to my shop!</p> <p></p> <p><span class="display-block">I am from south of Ukraine city of Kherson and my heart is broken now. I try to help how I can, I have connections with many people from Ukraine, with volunteers in Ukraine and Poland who help civilian in Ukraine and I sent my personal funds to the volunteers who I trust.</span></p> <p>All profit from my shop will be donated to the Ukrainian people.<br></p> <p></p> <p>My name is Mariya. I like to create things with my hands and I want to show my creations expressed in the form of handcrafted artwork.</p> <p>My shop name MriyaWeave. "Mriya<span class="mt-xs-1">" means "dream" in</span> <span class="mt-xs-1">the Ukrainian language as I was born and lived in Ukraine a big part of my life. This is my “dream artwork" - felting, knitting, eco printing.&nbsp;</span></p> <p></p> <p>Living in the rural country and <span class="tlid-translation translation" lang="en">listening to the birds singing</span><span class="tlid-translation"></span><span class="tlid-translation"><span></span></span>, the <span class="tlid-translation">rustle of herbs and flowers, trees talk I weave it into my textiles using </span><span class="mt-xs-1">different fibers given to us by nature - wool, silk, cotton, transforming them into unique and beautiful textiles </span><span class="tlid-translation">using an old craft processes, known as wet felting.&nbsp; I was hooked by the magic of wet felting </span><span class="tlid-translation">when a fabric, a living image, is born from a bunch of scattered fibers of wool, silk and other fibers. In my work I use a lot of recycled material, old silk, cotton, and viscose rags and turn them into new forms of life and style.&nbsp; </span><span class="tlid-translation">&nbsp;</span><br> <br></p> <p></p> <p></p> <p></p> <p><br> </p> <p></p> <p><strong>Processing time:</strong><br></p> <p>Please allow 1-2 business days for your items to ship.<br></p> <p><strong>Custom order:</strong></p> <p> shipping times for custom orders vary depending on the order and number or orders received.&nbsp; Shipping times will be communicated on an individual basis when we discuss your order. <br></p> <p><strong>Location:</strong> Orders are shipped from Charleston IL.</p> <p>If you have a question about shipping feel free to contact me.</p> <p><strong>I accept returns and exchange.</strong><br></p> <p>Items can be refunded or exchanged if you contact me within 3 days of delivery,</p> <p>Ship item back within 7days of delivery if item has not been used or damaged. <br></p> <p>The buyer is responsible for all expenses needed to ship the item back to me.&nbsp; <br></p> <p>Upon receipt of same 100%&nbsp; credit will be refunded.</p> <p>The following items can't be returned or exchanged <br></p> <p> Because of the nature of these items, unless they arrive damaged or defective, I can't accept returns for: </p> <p><span class="checkbox-label">Custom or personalized orders<br></span></p> <p><span class="checkbox-label">Digital downloads</span></p> <p><span class="checkbox-label">Perishable products (like food or flowers)<br></span></p> <p><span class="checkbox-label">Intimate items (for health/hygiene reasons)</span><br><strong></strong><strong>I accept cancellation </strong>if buyer contact me within 3 hours after purchase anyway before I buy shipping label. <br></p> <p></p> <p>Positive transactions & feedback are very important to me, if you have any questions or problems please contact me BEFORE leaving feedback, so I can correct any mistakes.</p> <p>Thank You!</p> <p></p> <p></p> {"tmenu_style":"V","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":"","vbp_3_url":"","vba_1_url":"","vba_2_url":"","vba_3_url":""} MriyaWeave Charleston A MriyaWeave Charleston IL US 61920 vima14@aol.com none Y 1584557721 0 a:4:{s:14:"company_fields";a:2:{i:37;s:6:"Mariya";i:38;s:8:"Gerhardt";}s:15:"admin_firstname";s:6:"Mariya";s:14:"admin_lastname";s:8:"Gerhardt";s:6:"fields";a:0:{}} 2 acct_1GO9DxAvquHfv1z6 195482,195480,195477,195519,195730,195764 UA-177004262-1 https://www.facebook.com/MriyaWeave https://www.instagram.com/mriyaweave/ UA-177004262-1 A {"items_per_file":"2500","time_from":"","time_to":""} N 0 0 0 0 0 S Growth Plan mriyaweave 5.0000 105_35