SELECT 
  cscart_companies.company_id, 
  cscart_companies.lang_code, 
  cscart_companies.email, 
  cscart_companies.timestamp, 
  cscart_companies.status, 
  company_descr.i18n_company as company, 
  cscart_companies.tax_number, 
  cscart_company_descriptions.company_description, 
  cscart_companies.paypal_commerce_platform_account_id, 
  cscart_companies.stripe_connect_account_id, 
  absolute_rating.rating AS absolute_vendor_rating, 
  cscart_vendor_plan_descriptions.plan, 
  cscart_seo_names.name as seo_name, 
  cscart_seo_names.path as seo_path, 
  AVG(
    cscart_discussion_rating.rating_value
  ) AS average_rating, 
  CONCAT(
    cscart_companies.company_id, 
    '_', 
    IF (
      cscart_discussion_rating.thread_id, 
      cscart_discussion_rating.thread_id, 
      '0'
    )
  ) AS company_thread_ids 
FROM 
  cscart_companies 
  LEFT JOIN cscart_company_descriptions as company_descr ON company_descr.company_id = cscart_companies.company_id 
  AND company_descr.lang_code = 'en' 
  LEFT JOIN cscart_company_descriptions ON cscart_company_descriptions.company_id = cscart_companies.company_id 
  AND cscart_company_descriptions.lang_code = 'en' 
  LEFT JOIN cscart_absolute_rating AS absolute_rating ON absolute_rating.object_id = cscart_companies.company_id 
  AND absolute_rating.object_type = 'company' 
  LEFT JOIN cscart_vendor_plan_descriptions ON cscart_companies.plan_id = cscart_vendor_plan_descriptions.plan_id 
  AND cscart_vendor_plan_descriptions.lang_code = 'en' 
  LEFT JOIN cscart_seo_names ON cscart_seo_names.object_id = cscart_companies.company_id 
  AND cscart_seo_names.type = 'm' 
  AND cscart_seo_names.dispatch = '' 
  AND cscart_seo_names.lang_code = 'en' 
  LEFT JOIN cscart_discussion ON cscart_discussion.object_id = cscart_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 
  1 
  AND cscart_companies.status = 'A' 
GROUP BY 
  company_thread_ids 
ORDER BY 
  company_descr.i18n_company desc 
LIMIT 
  0, 10

Query time 0.00147

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "17.23"
    },
    "ordering_operation": {
      "using_filesort": true,
      "grouping_operation": {
        "using_temporary_table": true,
        "using_filesort": false,
        "nested_loop": [
          {
            "table": {
              "table_name": "absolute_rating",
              "access_type": "system",
              "possible_keys": [
                "PRIMARY"
              ],
              "rows_examined_per_scan": 0,
              "rows_produced_per_join": 1,
              "filtered": "0.00",
              "const_row_not_found": true,
              "cost_info": {
                "read_cost": "0.00",
                "eval_cost": "0.10",
                "prefix_cost": "0.00",
                "data_read_per_join": "112"
              },
              "used_columns": [
                "object_id",
                "object_type",
                "rating"
              ]
            }
          },
          {
            "table": {
              "table_name": "cscart_companies",
              "access_type": "ALL",
              "rows_examined_per_scan": 38,
              "rows_produced_per_join": 3,
              "filtered": "10.00",
              "cost_info": {
                "read_cost": "5.45",
                "eval_cost": "0.38",
                "prefix_cost": "5.83",
                "data_read_per_join": "26K"
              },
              "used_columns": [
                "company_id",
                "status",
                "lang_code",
                "email",
                "timestamp",
                "tax_number",
                "plan_id",
                "stripe_connect_account_id",
                "paypal_commerce_platform_account_id"
              ],
              "attached_condition": "(`wearethehelpful_scalesta_net`.`cscart_companies`.`status` = 'A')"
            }
          },
          {
            "table": {
              "table_name": "company_descr",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "company_id",
                "lang_code"
              ],
              "key_length": "10",
              "ref": [
                "wearethehelpful_scalesta_net.cscart_companies.company_id",
                "const"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 3,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "0.00",
                "eval_cost": "0.38",
                "prefix_cost": "6.21",
                "data_read_per_join": "6K"
              },
              "used_columns": [
                "company_id",
                "lang_code",
                "i18n_company"
              ]
            }
          },
          {
            "table": {
              "table_name": "cscart_company_descriptions",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "company_id",
                "lang_code"
              ],
              "key_length": "10",
              "ref": [
                "wearethehelpful_scalesta_net.cscart_companies.company_id",
                "const"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 3,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "0.00",
                "eval_cost": "0.38",
                "prefix_cost": "6.59",
                "data_read_per_join": "6K"
              },
              "used_columns": [
                "company_id",
                "lang_code",
                "company_description"
              ]
            }
          },
          {
            "table": {
              "table_name": "cscart_vendor_plan_descriptions",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "plan_id",
                "lang_code"
              ],
              "key_length": "10",
              "ref": [
                "wearethehelpful_scalesta_net.cscart_companies.plan_id",
                "const"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 3,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "0.00",
                "eval_cost": "0.38",
                "prefix_cost": "6.97",
                "data_read_per_join": "2K"
              },
              "used_columns": [
                "plan_id",
                "lang_code",
                "plan"
              ]
            }
          },
          {
            "table": {
              "table_name": "cscart_seo_names",
              "access_type": "ref",
              "possible_keys": [
                "PRIMARY",
                "dispatch"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "object_id",
                "type",
                "dispatch",
                "lang_code"
              ],
              "key_length": "206",
              "ref": [
                "wearethehelpful_scalesta_net.cscart_companies.company_id",
                "const",
                "const",
                "const"
              ],
              "rows_examined_per_scan": 2,
              "rows_produced_per_join": 7,
              "filtered": "100.00",
              "index_condition": "<if>(is_not_null_compl(cscart_seo_names), (`wearethehelpful_scalesta_net`.`cscart_seo_names`.`object_id` = `wearethehelpful_scalesta_net`.`cscart_companies`.`company_id`), true)",
              "cost_info": {
                "read_cost": "1.90",
                "eval_cost": "0.76",
                "prefix_cost": "9.63",
                "data_read_per_join": "12K"
              },
              "used_columns": [
                "name",
                "object_id",
                "type",
                "dispatch",
                "path",
                "lang_code"
              ]
            }
          },
          {
            "table": {
              "table_name": "cscart_discussion",
              "access_type": "eq_ref",
              "possible_keys": [
                "object_id"
              ],
              "key": "object_id",
              "used_key_parts": [
                "object_id",
                "object_type"
              ],
              "key_length": "6",
              "ref": [
                "wearethehelpful_scalesta_net.cscart_companies.company_id",
                "const"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 7,
              "filtered": "100.00",
              "index_condition": "<if>(is_not_null_compl(cscart_discussion), (`wearethehelpful_scalesta_net`.`cscart_discussion`.`object_id` = `wearethehelpful_scalesta_net`.`cscart_companies`.`company_id`), true)",
              "cost_info": {
                "read_cost": "0.00",
                "eval_cost": "0.76",
                "prefix_cost": "10.39",
                "data_read_per_join": "182"
              },
              "used_columns": [
                "thread_id",
                "object_id",
                "object_type"
              ]
            }
          },
          {
            "table": {
              "table_name": "cscart_discussion_posts",
              "access_type": "ref",
              "possible_keys": [
                "thread_id",
                "thread_id_2"
              ],
              "key": "thread_id",
              "used_key_parts": [
                "thread_id"
              ],
              "key_length": "3",
              "ref": [
                "wearethehelpful_scalesta_net.cscart_discussion.thread_id"
              ],
              "rows_examined_per_scan": 2,
              "rows_produced_per_join": 15,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "3.80",
                "eval_cost": "1.52",
                "prefix_cost": "15.71",
                "data_read_per_join": "6K"
              },
              "used_columns": [
                "post_id",
                "thread_id",
                "status"
              ],
              "attached_condition": "<if>(is_not_null_compl(cscart_discussion_posts), (`wearethehelpful_scalesta_net`.`cscart_discussion_posts`.`status` = 'A'), true)"
            }
          },
          {
            "table": {
              "table_name": "cscart_discussion_rating",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY",
                "thread_id"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "post_id"
              ],
              "key_length": "3",
              "ref": [
                "wearethehelpful_scalesta_net.cscart_discussion_posts.post_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 15,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "0.00",
                "eval_cost": "1.52",
                "prefix_cost": "17.23",
                "data_read_per_join": "243"
              },
              "used_columns": [
                "rating_value",
                "post_id",
                "thread_id"
              ],
              "attached_condition": "<if>(is_not_null_compl(cscart_discussion_rating), (`wearethehelpful_scalesta_net`.`cscart_discussion_rating`.`thread_id` = `wearethehelpful_scalesta_net`.`cscart_discussion`.`thread_id`), true)"
            }
          }
        ]
      }
    }
  }
}

Result

company_id lang_code email timestamp status company tax_number company_description paypal_commerce_platform_account_id stripe_connect_account_id absolute_vendor_rating plan seo_name seo_path average_rating company_thread_ids
24 en jenny@yogalinks.co.uk 1729803545 A Yoga Links acct_1NmieWA8IyFZGDto LAUNCH - 10% yoga-links 24_0
18 en info@wordswithwine.com 1728551158 A Words With Wine acct_1QNaj92aQAmNyXe4 LAUNCH - 10% words-with-wine 18_0
31 en info@wildscottishsauna.com 1738885449 A Wild Scottish Sauna acct_1Qs5y6FStXtqQdaH Launch - 15% wild-scottish-sauna 31_0
4 en kate@wearethehelpful.com 1719394819 A We are The Helpful <p><br /></p> <p><br /><br /></p> acct_1QNAlWKiNYt4A4TK WE ARE THE HELPFUL RETAIL gentle-habits 4_0
44 en hello@your-tonic.com 1753805533 A TONIC 474245286 acct_1SNFClQPW1RI47wg Launch - 20% tonic 44_0
42 en hello@tiredmumscoffee.co.uk 1750160357 A Tired Mums Coffee Limited 475838539 <p>Tired Mums Coffee is committed to supporting others through blending the smoothest coffees, that are bursting with flavour and goodness.</p> <p>We believe your daily coffee ritual is about more than just caffeine, it can provide the space to breath, re-connect and REVIVE - one cup at a time. </p> <p>Our coffee is blended by mums who have experienced first hand the challenges of balancing NHS careers, parenthood and personal well-being.</p> <p>We're passionate about coffee and the positive impact it can have, and have created the smoothest coffees that can get you through the entire day.</p> <p>Our community is growing and we remain committed to donating 1% of all coffee sales to charities that support parents.</p> acct_1RayqiFaKrUUonOL Launch - 15% tired-mums-coffee-limited 42_0
25 en anna@thesabi.co 1729997105 A The SABI 437 4786 57 <p><span style="font-size:32px;font-weight:700;">Empowered Wellness</span></p> <p><span>Our all-natural products, daily self-care rituals and guidance empower you to take charge of your wellbeing. Combining traditional women’s medicine and the best of modern technology, we leverage the</span><b> magic and science of plants</b><span> for hormonal balancing in our debut collection of restorative skin care and herbal infusions.</span></p> acct_1QvypMGgHcirGvqp Launch - 20% the-sabi 25_0
16 en thefooddoula@gmail.com 1728470552 A The Food Doula acct_1DYz0EG1gMh3cMR4 Launch - 15% the-food-doula 16_0
26 en Detoxkitchen@wearethehelpful.com 1732444833 A The Detox Kitchen WE ARE THE HELPFUL RETAIL the-detox-kitchen 26_0
41 en info@beautystandard.co.uk 1749464426 A The Beauty Standard 471043419 acct_1RfmSMIwFGde1lOR Launch - 20% the-beauty-standard 41_0