SELECT 
  company_descriptions.*, 
  companies.*, 
  cscart_vendor_plan_descriptions.plan, 
  AVG(
    cscart_discussion_rating.rating_value
  ) AS average_rating, 
  CONCAT(
    companies.company_id, 
    '_', 
    IF (
      cscart_discussion_rating.thread_id, 
      cscart_discussion_rating.thread_id, 
      '0'
    )
  ) AS company_thread_ids 
FROM 
  cscart_companies AS companies 
  LEFT JOIN cscart_company_descriptions AS company_descriptions ON company_descriptions.company_id = companies.company_id 
  AND company_descriptions.lang_code = 'ru' 
  LEFT JOIN cscart_vendor_plan_descriptions ON companies.plan_id = cscart_vendor_plan_descriptions.plan_id 
  AND cscart_vendor_plan_descriptions.lang_code = 'ru' 
  LEFT JOIN cscart_discussion ON cscart_discussion.object_id = companies.company_id 
  AND cscart_discussion.object_type = 'M' 
  LEFT JOIN cscart_discussion_posts ON cscart_discussion_posts.thread_id = cscart_discussion.thread_id 
  AND cscart_discussion_posts.status = 'A' 
  LEFT JOIN cscart_discussion_rating ON cscart_discussion.thread_id = cscart_discussion_rating.thread_id 
  AND cscart_discussion_rating.post_id = cscart_discussion_posts.post_id 
WHERE 
  companies.company_id = 6

Query time 0.01127

JSON explain

{
  "query_block": {
    "select_id": 1,
    "const_condition": "1",
    "nested_loop": [
      {
        "table": {
          "table_name": "companies",
          "access_type": "const",
          "possible_keys": ["PRIMARY"],
          "key": "PRIMARY",
          "key_length": "4",
          "used_key_parts": ["company_id"],
          "ref": ["const"],
          "rows": 1,
          "filtered": 100
        }
      },
      {
        "table": {
          "table_name": "company_descriptions",
          "access_type": "const",
          "possible_keys": ["PRIMARY"],
          "key": "PRIMARY",
          "key_length": "10",
          "used_key_parts": ["company_id", "lang_code"],
          "ref": ["const", "const"],
          "rows": 1,
          "filtered": 100
        }
      },
      {
        "table": {
          "table_name": "cscart_vendor_plan_descriptions",
          "access_type": "const",
          "possible_keys": ["PRIMARY"],
          "key": "PRIMARY",
          "key_length": "10",
          "used_key_parts": ["plan_id", "lang_code"],
          "ref": ["const", "const"],
          "rows": 1,
          "filtered": 100
        }
      },
      {
        "table": {
          "table_name": "cscart_discussion",
          "access_type": "const",
          "possible_keys": ["object_id"],
          "key": "object_id",
          "key_length": "6",
          "used_key_parts": ["object_id", "object_type"],
          "ref": ["const", "const"],
          "rows": 0,
          "filtered": 0,
          "unique_row_not_found": true
        }
      },
      {
        "table": {
          "table_name": "cscart_discussion_posts",
          "access_type": "const",
          "possible_keys": ["thread_id", "thread_id_2"],
          "rows": 1,
          "filtered": 100
        }
      },
      {
        "table": {
          "table_name": "cscart_discussion_rating",
          "access_type": "const",
          "possible_keys": ["PRIMARY", "thread_id"],
          "rows": 1,
          "filtered": 100
        }
      }
    ]
  }
}

Result

company_id lang_code company_description i18n_company i18n_address i18n_city terms 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 tax_number registered_from_storefront_id agent_type plan_id pre_moderation pre_moderation_edit pre_moderation_edit_vendors robokassa_store_id robokassa_account_number suspend_date grace_period_start last_time_suspended last_debt_notification_time plan average_rating company_thread_ids
6 ru <p><span style="background-color: initial;">ООО "Всё для дома"</span></p><h2>Описание:</h2><p>Обновить интерьер, выбрать подарки! "Все для дома" - компания помогающая, сделать дом уютным и комфортным. Сделать его таким, чтобы Ваши близкие спешили к домашнему очагу и радовались каждому дню, проведенному в кругу семьи.</p><p>Мы предлагаем на выбор 40 тысяч наименований продукции от ведущих мировых производителей, чья репутация не вызывает сомнений. Вся электроника и бытовая техника перед отправкой клиенту проверяется в обязательном порядке, комплектуется гарантийными документами и подробной инструкцией.</p><h2><span style="background-color: initial;">Реквизиты компании</span><span style="color: rgb(51, 51, 51); background-color: initial;"></span></h2><table><tbody><tr><td><table> <tbody> </tbody></table><p><span style="background-color: initial;">Наименование:</span></p></td> <td> <span style="background-color: initial;">Общество с ограниченной ответственностью «Все для дома», ООО «Все для дома»</span></td></tr><tr><td> <span style="background-color: initial;">Юридический адрес:</span> </td> <td>г. <span style="background-color: initial;">Санкт-Петрбург, пр. Невский д. 1</span> </td></tr><tr><td> <span style="background-color: initial;">Фактический адрес:</span> </td> <td> <span style="background-color: initial;">г. Санкт-Петрбург, пр. Невский д. 1</span></td></tr><tr><td> <span style="background-color: initial;">ИНН/КПП:</span> </td> <td> <span style="background-color: initial;">7700011101/030201111</span> </td></tr><tr><td> <span style="background-color: initial;">ОГРН:</span></td> <td>010102020303</td></tr></tbody></table><h2><span style="background-color: initial;">Банковские реквизиты</span></h2><table><tbody><tr><td>Полное наименование:</td> <td>ООО "Все для дома"</td></tr><tr><td>ИНН:</td> <td>701234560111</td></tr><tr><td>ОГРН: </td> <td>304123456012301 </td></tr><tr><td>Банк: </td> <td>ОАО АКБ "Авангард"</td></tr><tr><td>Р/С:</td> <td>50101010202020202031</td></tr><tr><td>БИК </td> <td>040311111 </td></tr><tr><td>К/С </td> <td>30101010102020203031</td></tr></tbody></table> A Всё для дома Невский проспект 1 Санкт-Петрбург LEN RU 190068 vdd@example.com +79096666666 none Y 1404900638 11,1,10,6 0 payment_agent 2 N N N 0 0 1775667086 0 1776143545 Базовый 6_0