Query time 0.00267
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "17.11"
},
"ordering_operation": {
"using_filesort": true,
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "cscart_companies",
"access_type": "ALL",
"rows_examined_per_scan": 13,
"rows_produced_per_join": 1,
"filtered": "10.00",
"cost_info": {
"read_cost": "5.55",
"eval_cost": "0.26",
"prefix_cost": "5.81",
"data_read_per_join": "20K"
},
"used_columns": [
"company_id",
"status",
"company",
"lang_code",
"email",
"timestamp",
"plan_id"
],
"attached_condition": "(`marketpl_db`.`cscart_companies`.`status` = 'A')"
}
},
{
"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": [
"marketpl_db.cscart_companies.company_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.30",
"eval_cost": "0.26",
"prefix_cost": "7.37",
"data_read_per_join": "52"
},
"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": [
"marketpl_db.cscart_companies.plan_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.30",
"eval_cost": "0.26",
"prefix_cost": "8.93",
"data_read_per_join": "1K"
},
"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": [
"marketpl_db.cscart_companies.company_id",
"const",
"const",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.30",
"eval_cost": "0.26",
"prefix_cost": "10.49",
"data_read_per_join": "2K"
},
"used_columns": [
"name",
"object_id",
"type",
"dispatch",
"path",
"lang_code"
],
"attached_condition": "<if>(is_not_null_compl(cscart_seo_names), (`marketpl_db`.`cscart_seo_names`.`object_id` = `marketpl_db`.`cscart_companies`.`company_id`), true)"
}
},
{
"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": [
"marketpl_db.cscart_companies.company_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.30",
"eval_cost": "0.26",
"prefix_cost": "12.05",
"data_read_per_join": "20"
},
"used_columns": [
"thread_id",
"object_id",
"object_type"
],
"attached_condition": "<if>(is_not_null_compl(cscart_discussion), (`marketpl_db`.`cscart_discussion`.`object_id` = `marketpl_db`.`cscart_companies`.`company_id`), true)"
}
},
{
"table": {
"table_name": "cscart_discussion_posts",
"access_type": "ALL",
"possible_keys": [
"thread_id",
"thread_id_2"
],
"rows_examined_per_scan": 2,
"rows_produced_per_join": 2,
"filtered": "100.00",
"using_join_buffer": "Block Nested Loop",
"cost_info": {
"read_cost": "2.02",
"eval_cost": "0.52",
"prefix_cost": "14.59",
"data_read_per_join": "1K"
},
"used_columns": [
"post_id",
"thread_id",
"status"
],
"attached_condition": "<if>(is_not_null_compl(cscart_discussion_posts), ((`marketpl_db`.`cscart_discussion_posts`.`thread_id` = `marketpl_db`.`cscart_discussion`.`thread_id`) and (`marketpl_db`.`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": [
"marketpl_db.cscart_discussion_posts.post_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 2,
"filtered": "100.00",
"cost_info": {
"read_cost": "2.00",
"eval_cost": "0.52",
"prefix_cost": "17.11",
"data_read_per_join": "41"
},
"used_columns": [
"rating_value",
"post_id",
"thread_id"
],
"attached_condition": "<if>(is_not_null_compl(cscart_discussion_rating), (`marketpl_db`.`cscart_discussion_rating`.`thread_id` = `marketpl_db`.`cscart_discussion`.`thread_id`), true)"
}
}
]
}
}
}
}
Result
| company_id |
lang_code |
email |
company |
timestamp |
status |
company_description |
plan |
seo_name |
seo_path |
average_rating |
company_thread_ids |
| 123 |
|
ana@myles.com |
Black velvet |
1605045973 |
A |
lksdjo |
Basic |
black-velvet |
|
|
123_0 |
| 118 |
|
bam@mas.com.gt |
Bam |
1605044137 |
A |
ambl |
Basic |
bam |
|
|
118_0 |
| 124 |
|
alone@heart.com |
Alone |
1605051678 |
A |
ajisodjwo |
Standard |
alone |
|
|
124_0 |