Query time 0.00833
JSON explain
{
"query_block": {
"select_id": 1,
"cost": 0.062135642,
"filesort": {
"sort_key": "company_descr.i18n_company",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "absolute_rating",
"access_type": "system",
"possible_keys": ["PRIMARY"],
"rows": 0,
"filtered": 0,
"const_row_not_found": true
}
},
{
"table": {
"table_name": "tmall_companies",
"access_type": "ALL",
"loops": 1,
"rows": 2,
"cost": 0.01034841,
"filtered": 100,
"attached_condition": "tmall_companies.`status` = 'A'"
}
},
{
"table": {
"table_name": "company_descr",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "10",
"used_key_parts": ["company_id", "lang_code"],
"ref": ["tmall.tmall_companies.company_id", "const"],
"loops": 2,
"rows": 1,
"cost": 0.003662852,
"filtered": 100,
"attached_condition": "trigcond(company_descr.lang_code = 'en')"
}
},
{
"table": {
"table_name": "tmall_company_descriptions",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "10",
"used_key_parts": ["company_id", "lang_code"],
"ref": ["tmall.tmall_companies.company_id", "const"],
"loops": 2,
"rows": 1,
"cost": 0.003662852,
"filtered": 100,
"attached_condition": "trigcond(tmall_company_descriptions.lang_code = 'en')"
}
},
{
"table": {
"table_name": "tmall_vendor_plan_descriptions",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "10",
"used_key_parts": ["plan_id", "lang_code"],
"ref": ["tmall.tmall_companies.plan_id", "const"],
"loops": 2,
"rows": 1,
"cost": 0.003662852,
"filtered": 100,
"attached_condition": "trigcond(tmall_vendor_plan_descriptions.lang_code = 'en')"
}
},
{
"table": {
"table_name": "tmall_discussion",
"access_type": "eq_ref",
"possible_keys": ["object_id"],
"key": "object_id",
"key_length": "6",
"used_key_parts": ["object_id", "object_type"],
"ref": ["tmall.tmall_companies.company_id", "const"],
"loops": 2,
"rows": 1,
"cost": 0.003662852,
"filtered": 100,
"attached_condition": "trigcond(tmall_discussion.object_id = tmall_companies.company_id and tmall_discussion.object_type = 'M')"
}
},
{
"table": {
"table_name": "tmall_discussion_posts",
"access_type": "ref",
"possible_keys": ["thread_id", "thread_id_2"],
"key": "thread_id",
"key_length": "3",
"used_key_parts": ["thread_id"],
"ref": ["tmall.tmall_discussion.thread_id"],
"loops": 2,
"rows": 6,
"cost": 0.016182712,
"filtered": 100,
"attached_condition": "trigcond(tmall_discussion_posts.`status` = 'A' and trigcond(tmall_discussion.thread_id is not null))"
}
},
{
"table": {
"table_name": "tmall_discussion_rating",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "thread_id"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["post_id"],
"ref": ["tmall.tmall_discussion_posts.post_id"],
"loops": 12,
"rows": 1,
"cost": 0.020953112,
"filtered": 100,
"attached_condition": "trigcond(tmall_discussion_rating.thread_id = tmall_discussion.thread_id and trigcond(tmall_discussion_posts.post_id is not null))"
}
}
]
}
}
}
}
Result
| company_id |
lang_code |
email |
timestamp |
status |
company |
tax_number |
company_description |
absolute_vendor_rating |
plan |
average_rating |
company_thread_ids |
| 2 |
en |
acme_corp@example.com |
1269610461 |
A |
ACME Corp |
|
A Company that Makes Everything |
|
Bronze |
|
2_0 |
| 1 |
en |
cs-cart@example.com |
1269610461 |
A |
CS-Cart |
|
The company that makes the best shopping cart software in the world |
|
Gold |
|
1_0 |