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

Query time 0.00131

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
8 ru <p><span style="background-color: initial;">ООО "Мир спорта"</span></p><h2><span style="background-color: initial;">Описание компании</span></h2><p> ООО "Мир спорта" – спортивный магазин для всей семьи!</p><p>Все для спорта и активного отдыха – от самых простых спорттоваров до технологичного снаряжения последнего поколения. <span style="background-color: initial;">Наши магазины посещает более 60 миллионов человек. </span><span style="background-color: initial;">При этом мы уделяем огромное внимание уровню технологичности всех предлагаемых товаров.</span></p><p><span style="background-color: initial;">Интересы клиентов всегда на первом месте!</span></p><h2>Реквизиты компании<span style="color: rgb(51, 51, 51); background-color: initial;"></span></h2><table><tbody><tr> <td> <span style="background-color: initial;">Наименование:</span></td> <td> <span style="background-color: initial;">Общество с ограниченной ответственностью «Мир спорта», ООО «Мир спорта»</span></td></tr><tr><td> Юридический адрес: </td> <td> г. Сочи, ул. Московская д. 17</td></tr><tr><td> Фактический адрес: </td> <td> <span style="background-color: initial;">г. Сочи, ул. Московская д. 17</span></td></tr><tr><td> ИНН/КПП: </td> <td> <span style="background-color: initial;">4014012106/372501001</span> </td></tr><tr><td> <span style="background-color: initial;">ОГРН:</span></td> <td> <span style="background-color: initial;">910170931122</span> </td></tr></tbody></table><h2>Банковские реквизиты</h2><table><tbody><tr><td>Полное наименование:</td> <td>ООО "Мир спорта"</td></tr><tr><td>ИНН:</td> <td>811252131327</td></tr><tr><td>ОГРН: </td> <td>580803152210133 </td></tr><tr><td>Банк: </td> <td><p>ОАО "Максимум" </p></td></tr><tr><td>Р/С:</td> <td>91511780900577731082</td></tr><tr><td>БИК </td> <td>095182321 </td></tr><tr><td>К/С </td> <td>98007610505050504352</td></tr></tbody></table> A Мир спорта Московская 17 Сочи KDA RU 354393 sport@example.com +79098888888 none Y 1404900773 1,7,10,11,9,6 0 payment_agent 2 N N N 0 0 0 0 Базовый 8_0