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

Query time 0.01095

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
3 ru <p><span style="background-color: initial;">ООО "Мой диск"</span></p><h2><span style="background-color: initial;">Описание компании</span></h2><p> Магазин ООО "Мой диск" предлагает огромный ассортимент дисков: CD<span style="background-color: initial;">, DVD, Blu-Ray и др. носители. </span><span style="background-color: initial;">Теперь дома или в компании друзей вы можете посмотреть новинки кинематографа в прекрасном качестве, послушать музыку любого стиля и направления, включая раритетные записи, по дороге на работу и обратно домой слушать аудиокнигу</span><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> г. Ульяновск, ул. Мира д. 3</td></tr><tr><td> Фактический адрес: </td> <td><p> г. Ульяновск, ул. Мира д. 3 </p></td></tr><tr><td> ИНН/КПП: </td> <td> <span style="background-color: initial;">4409011186/741541311</span> </td></tr><tr><td> <span style="background-color: initial;">ОГРН:</span></td> <td> <span style="background-color: initial;">150180117131</span> </td></tr></tbody></table><h2>Банковские реквизиты</h2><table><tbody><tr><td>Полное наименование:</td> <td>ООО "Мой диск"</td></tr><tr><td>ИНН:</td> <td>287801131231</td></tr><tr><td>ОГРН: </td> <td>582113005131201 </td></tr><tr><td>Банк: </td> <td><p> ООО "КБ "Межтрастбанк"</p></td></tr><tr><td>Р/С:</td> <td>28111110707311730874</td></tr><tr><td>БИК </td> <td>025102877 </td></tr><tr><td>К/С </td> <td>34540710505080531107</td></tr></tbody></table> A Мой диск Мира 3 Ульяновск ULY RU 432007 cd@example.com +79093333333 none Y 1404900414 1,7,10,11,9,6 0 payment_agent 2 N N N 0 0 0 0 Базовый 3_0