Query time 0.00074
JSON explain
{
"query_block": {
"select_id": 1,
"cost": 0.06152132,
"nested_loop": [
{
"table": {
"table_name": "cscart_companies",
"access_type": "ALL",
"loops": 1,
"rows": 14,
"cost": 0.0131368,
"filtered": 100,
"attached_condition": "cscart_companies.`status` = 'A'"
}
},
{
"table": {
"table_name": "cscart_seo_names",
"access_type": "ref",
"possible_keys": ["PRIMARY", "dispatch"],
"key": "PRIMARY",
"key_length": "206",
"used_key_parts": ["object_id", "type", "dispatch", "lang_code"],
"ref": [
"u508912950_dev_2025.cscart_companies.company_id",
"const",
"const",
"const"
],
"loops": 14,
"rows": 1,
"cost": 0.02005758,
"filtered": 100,
"attached_condition": "trigcond(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')"
}
},
{
"table": {
"table_name": "cscart_discussion",
"access_type": "eq_ref",
"possible_keys": ["object_id"],
"key": "object_id",
"key_length": "6",
"used_key_parts": ["object_id", "object_type"],
"ref": ["u508912950_dev_2025.cscart_companies.company_id", "const"],
"loops": 14,
"rows": 1,
"cost": 0.01388007,
"filtered": 100,
"attached_condition": "trigcond(cscart_discussion.object_id = cscart_companies.company_id and cscart_discussion.object_type = 'M')",
"using_index": true
}
},
{
"table": {
"table_name": "cscart_discussion_posts",
"access_type": "ref",
"possible_keys": ["thread_id", "thread_id_2"],
"key": "thread_id_2",
"key_length": "6",
"used_key_parts": ["thread_id", "status"],
"ref": ["u508912950_dev_2025.cscart_discussion.thread_id", "const"],
"loops": 14,
"rows": 1,
"cost": 0.01444687,
"filtered": 100,
"attached_condition": "trigcond(cscart_discussion_posts.`status` = 'A' and trigcond(cscart_discussion.thread_id is not null))",
"using_index": true
}
}
]
}
}
Result
| COUNT(DISTINCT(cscart_companies.company_id)) |
| 10 |