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

Query time 0.00107

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "2.59"
    },
    "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.59",
            "eval_cost": "0.10",
            "prefix_cost": "1.54",
            "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.97",
            "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.59",
            "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
2206 en <p>Since a very young age, I wanted to be an artist. You could say that art was my first love. My journey has been an interesting one, including studying art at university, changing later to seek a degree in chemistry and mathematics, then spending almost 20 years in England, running a successful retail shop, finally returning to the USA, and becoming the mother of three beautiful children. Each of these life experiences has influenced my love of art in different ways, and while I continued to draw and paint, I also developed a love of physical materials, colorful hand made items, and jewelry. I find that jewelry making incorporates many enjoyable aspects of art, allowing me to combine my science, math, and art skills to create items that I hope will bring joy to others.</p> <p>Note: &nbsp;You may from time to time see jewelry or home decor items that feature raised dots. &nbsp;These dots are braille, which is a code that allows blind and visually impaired people to read with their fingers. My children help me with this part of the business!</p> <p><strong>FAQs</strong></p> <p><strong>Are all of your items made by you?</strong></p> <p>Yes! &nbsp;I have a home studio-workshop and make every single item I sell, occasionally with the help of my eldest daughter, using raw materials which are cut and finished with paints, beads, and hardware.</p> <p><strong>What materials do you use?</strong></p> <p>Though I also work with wood, I mainly work with acrylic, as I love color--all color--and acrylic offers shimmer and shine with translucence or transparence. &nbsp;Some of the more exotic acrylics are often only available in limited quantities, so if you see a piece made of an especially eye-catching color or swirl or marbled look (to give examples), grab it while it's available!</p> <p><strong>How should I care for acrylic jewelry?</strong></p> <p>Items made of acrylic can scratch easily and should not be wiped or cleaned using solvents or chemical cleaners, as this may damage the acrylic. &nbsp;Avoid allowing acrylic items to knock against other items. &nbsp;It is better to hang acrylic earrings than to store them flat, because the ear wires could damage the material.<br></p> <p><strong>How long will it take to receive my items?</strong></p> <p>If you need items quickly or for a special occasion, please upgrade to Priority shipping. &nbsp;The USPS is currently experiencing longer than normal mailing times, and non-priority mail times are not guaranteed. &nbsp;Unfortunately, we cannot offer refunds due to USPS delays.</p> <p><br></p> <p><strong>TERMS</strong></p> <p><strong>Processing Times</strong></p> <p>Items which are in stock and are not customized or personalized will generally be shipped within 1-3 business days. &nbsp;Customized or personalized items may take longer; shipping terms will be agreed upon prior to customized or personalized items being made.</p> <p><strong>Shipping Times</strong></p> <p>The USPS is experiencing slower than normal shipping times. &nbsp;If you need an item for a special occasion, please take this into account and consider upgrading to Priority shipping. &nbsp;It costs a few dollars more, but it offers tracking and insurance. &nbsp;We cannot be liable for delays caused by the USPS.&nbsp;</p> <p><strong>Refunds</strong><br></p> <p>If your item arrives damaged or defective, please notify us within 14 days so that we can evaluate the issue and make it right. &nbsp;We want you to be happy! &nbsp;Before returning your item, please contact us to discuss the damages (you may be asked for proof of damage or defect). &nbsp;If approved, we will give you a return number and mailing instructions. &nbsp;You must then return your item in the same condition that you received it, unworn or unused, with tags, and in its original packaging, with the return number noted on the package. You’ll also need the receipt or proof of purchase. &nbsp;Items sent back to us without first requesting a returns authorization number will not be accepted. &nbsp;We cannot accept returns of items unless damaged or faulty.</p> <p>We will notify you once we’ve received and inspected your return and let you know if the refund was approved or not. If approved, you’ll be automatically refunded on your original payment method. Please remember it can take some time for your bank or credit card company to process and post the refund, too.</p> {"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":""} Bel Creative Arts Midlothian A Bel Creative Arts Midlothian VA US 23113 belcreativearts@gmail.com none Y 1621521228 0 3 acct_1ItHjMK8DOQeeXO6 107541,83709,83710,83718,83729,83711 DDYUH3824L48U Custom designed jewelry & gifts hand made in Virginia. https://www.facebook.com/BelCreativeArts/ https://www.instagram.com/belcreativearts/ <p>A portion of every purchase from our site benefits children in need.</p> A N 0 0 0 0 0 S Professional Plan bel-creative-arts 2206_0