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

Query time 0.00191

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "2.88"
    },
    "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.88",
            "eval_cost": "0.10",
            "prefix_cost": "0.98",
            "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.76",
            "eval_cost": "0.10",
            "prefix_cost": "1.84",
            "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.27",
            "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.88",
            "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
3286 en <p>Rietveld Designs is a family owned shop located in Waucedah Township in beautiful Upper Michigan. Each item is created one at a time in the small shop in the basement. Our value is in our ability to create custom items in wood, copper pipe, resin printing, etc. Send for a quote for custom items- email with a picture or description of what you are looking for. In the Dickinson County area we can produce larger items that don't need shipping. </p> <p>Mark has over 31 years of experience in woodworking. Over the years he has built cabinets, made and installed countertops, laid out kitchens, and made many custom projects with both wood and some metal. Artistry runs in his family and he enjoys drawing up and creating new items out of wood for others to enjoy. Below are some recent pictures of custom projects he has completed.</p> <table><tbody><tr><td><img src="https://rietvelddesigns.com/assets/images/guitar stand.jpg" alt="Guitar stand " width="200" height="300" border="0" align="bottom"></td></tr></tbody></table> <table><tbody><tr><td><img src="https://rietvelddesigns.com/assets/images/WP_20201113_18_34_56_Pro.jpg" alt="Half round outdoor seating" width="300" height="200" border="0px"> </td></tr><tr><td><img src="https://rietvelddesigns.com/assets/images/WIN_20170605_182830.JPG" alt="Log Side table with light" width="200" height="300" border="0px"> </td></tr><tr><td><img src="https://rietvelddesigns.com/assets/images/WP_20180320_11_56_34_Pro.jpg" alt="Music podiums" width="300" height="200" border="0px"> </td></tr><tr><td><img src="https://rietvelddesigns.com/assets/images/WIN_20170503_131300.JPG" alt="Log dog bowl" width="300" height="200" border="0px"> </td></tr><tr><td><img src="https://rietvelddesigns.com/assets/images/WP_20171019_13_29_42_Pro.jpg" alt="music room angled dividers" width="300" height="200" border="0"> </td></tr><tr><td><img src="https://rietvelddesigns.com/assets/images/WIN_20170320_142509.JPG" alt="copper pipe cat bowl holder" width="300" height="200" border="0px"> </td></tr></tbody></table> <p>Aneta Rietveld has been creating arts and crafts for the last 40 years. Some of her mediums of choice are cakes (30 years professionally), wood, acrylic paint, alcohol ink, rocks, natural materials, and 3d Printing. Most other types of arts and crafts have been tried at least once. She is always happy to do a custom piece of art for you- just ask for a custom quote. </p><br><p><i class="mailinglist-input form-control" type="text" name="email" placeholder=" Email Address" autocomplete="off" aria-required="true" aria-label="email address" aria-invalid="true"><i><i><br></i></i></i></p> <p><i class="mailinglist-input form-control" type="text" name="email" placeholder=" Email Address" autocomplete="off" aria-required="true" aria-label="email address" aria-invalid="true"><i><i><br></i></i></i><br></p> <p><i class="mailinglist-input form-control" type="text" name="email" placeholder=" Email Address" autocomplete="off" aria-required="true" aria-label="email address" aria-invalid="true"><i><i></i></i></i><br><i class="mailinglist-input form-control" type="text" name="email" placeholder=" Email Address" autocomplete="off" aria-required="true" aria-label="email address" aria-invalid="true"><i><i><br></i></i></i></p> <p><i class="mailinglist-input form-control" type="text" name="email" placeholder=" Email Address" autocomplete="off" aria-required="true" aria-label="email address" aria-invalid="true"><i><i><br></i></i></i><br></p> <p><i class="mailinglist-input form-control" type="text" name="email" placeholder=" Email Address" autocomplete="off" aria-required="true" aria-label="email address" aria-invalid="true"><i><i></i></i></i><br><i class="mailinglist-input form-control" type="text" name="email" placeholder=" Email Address" autocomplete="off" aria-required="true" aria-label="email address" aria-invalid="true"><i><i><br></i></i></i></p> <p><i class="mailinglist-input form-control" type="text" name="email" placeholder=" Email Address" autocomplete="off" aria-required="true" aria-label="email address" aria-invalid="true"><i><i><br></i></i></i><br></p> <p><i class="mailinglist-input form-control" type="text" name="email" placeholder=" Email Address" autocomplete="off" aria-required="true" aria-label="email address" aria-invalid="true"><i><i></i></i></i><br><i class="mailinglist-input form-control" type="text" name="email" placeholder=" Email Address" autocomplete="off" aria-required="true" aria-label="email address" aria-invalid="true"><i><i><br></i></i></i></p> <p><i class="mailinglist-input form-control" type="text" name="email" placeholder=" Email Address" autocomplete="off" aria-required="true" aria-label="email address" aria-invalid="true"><i><i><br></i></i></i><br></p> <p><i class="mailinglist-input form-control" type="text" name="email" placeholder=" Email Address" autocomplete="off" aria-required="true" aria-label="email address" aria-invalid="true"><i><i></i></i></i><br><i class="mailinglist-input form-control" type="text" name="email" placeholder=" Email Address" autocomplete="off" aria-required="true" aria-label="email address" aria-invalid="true"><i><i><br></i></i></i></p> <p><i class="mailinglist-input form-control" type="text" name="email" placeholder=" Email Address" autocomplete="off" aria-required="true" aria-label="email address" aria-invalid="true"><i><i><br></i></i></i><br></p> <p><i class="mailinglist-input form-control" type="text" name="email" placeholder=" Email Address" autocomplete="off" aria-required="true" aria-label="email address" aria-invalid="true"><i><i></i></i></i><br><i class="mailinglist-input form-control" type="text" name="email" placeholder=" Email Address" autocomplete="off" aria-required="true" aria-label="email address" aria-invalid="true"><i><i><br></i></i></i></p> <p><i class="mailinglist-input form-control" type="text" name="email" placeholder=" Email Address" autocomplete="off" aria-required="true" aria-label="email address" aria-invalid="true"><i><i><br></i></i></i><br></p> <p><i class="mailinglist-input form-control" type="text" name="email" placeholder=" Email Address" autocomplete="off" aria-required="true" aria-label="email address" aria-invalid="true"><i><i></i></i></i><br><i class="mailinglist-input form-control" type="text" name="email" placeholder=" Email Address" autocomplete="off" aria-required="true" aria-label="email address" aria-invalid="true"><i><i><br></i></i></i></p> <p><i class="mailinglist-input form-control" type="text" name="email" placeholder=" Email Address" autocomplete="off" aria-required="true" aria-label="email address" aria-invalid="true"><i><i><br></i></i><i class="mailinglist-input form-control" type="text" name="email" placeholder=" Email Address" autocomplete="off" aria-required="true" aria-label="email address" aria-invalid="true"><i><i></i></i></i><br><i class="mailinglist-input form-control" type="text" name="email" placeholder=" Email Address" autocomplete="off" aria-required="true" aria-label="email address" aria-invalid="true"><i><i><br></i></i></i><br></i><br></p> <p><i class="mailinglist-input form-control" type="text" name="email" placeholder=" Email Address" autocomplete="off" aria-required="true" aria-label="email address" aria-invalid="true"><i><i></i></i></i></p> <table> </table> <table></table> <table></table> <p></p> <table></table> <p></p> <p>1. Items for sale- Rietveld Designs creates all of their items themself. Items shown in stock are available immediately. Custom orders can be created to each customer's required needs- email mark@rietvelddesigns.com <br></p> <p>2. Shipping-For all items except oversized log items: <strong>On GoImagine all of the shipping is free.</strong>&nbsp; Oversized items like log furniture, cedar planters, tables, etc will only be sold and delivered by trailer in the Dickinson/Menominee/Delta County areas of Michigan and the Marinette County are of Wisconsin. <br>&nbsp;If an item is already made and in stock it will ship out the next business day with best methods (these could include USPS,UPS or Fed Ex). Tracking numbers will be sent to the customer.<br>&nbsp;For custom items- they will ship as soon as they are finished and dried enough to do so. Depending on the item and availability of goods to make item this could be anywhere from 1 week to 1 month. Customer will be sent photos of item to approve finished design/colors before shipping.<br>Insurance for the cost of the item will be added to all packages in case of breakage in transit.</p> <p>3.Returns- Items may be returned at the customer's shipping cost. An authorization should be asked for first through the original order form so we are aware item is being returned. Insurance should be added to package in case of breakage in transit. As soon as item is received in good shape refund will be issued.</p> {"tmenu_style":"H","default_colors":"N","link_color":"#274e13","label_color":"#5db437","icon_color":"#6aa84f","main_btn_color":"#b6d7a8","branded_text_color":"#6aa84f","vbp_1_url":"","vbp_2_url":"","vbp_3_url":"","vba_1_url":"","vba_2_url":"","vba_3_url":""} Rietveld Designs W2595 Waucedah Rd Vulcan A Rietveld Designs W2595 Waucedah Rd Vulcan MI US 49892 mark@rietvelddesigns.com none Y 1628799290 0 3 acct_1JTIJkDR9xzhhbqL 201317,195876,195883,195982,195979,195986,187160,195932,130362,180672,179916,179993 9BVZDBL3YHH9E Handcrafted items for a unique home https://www.facebook.com/Rietveld-Designs-101119202123542/ https://www.pinterest.com/rietvelddesigns/rietveld-designs/ <p><strong>We welcome custom orders of all kinds. 99% of our business is custom.Email us at mark@rietvelddesigns.com .<br></strong></p> UA-217402646-1 748328559463511 rietvelddesigns.com A N 0 0 0 0 0 S Professional Plan rietvelddesigns 3286_0