Query time 0.02288
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "1985.84"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "c",
"access_type": "index",
"possible_keys": [
"PRIMARY",
"p_category_id"
],
"key": "c_status",
"used_key_parts": [
"usergroup_ids",
"status",
"parent_id"
],
"key_length": "773",
"rows_examined_per_scan": 406,
"rows_produced_per_join": 40,
"filtered": "10.00",
"using_index": true,
"cost_info": {
"read_cost": "96.57",
"eval_cost": "4.06",
"prefix_cost": "100.63",
"data_read_per_join": "442K"
},
"used_columns": [
"category_id",
"status"
],
"attached_condition": "(`dev2`.`c`.`status` = 'A')"
}
},
{
"table": {
"table_name": "cd",
"access_type": "ref",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"dev2.c.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 40,
"filtered": "100.00",
"cost_info": {
"read_cost": "10.15",
"eval_cost": "4.06",
"prefix_cost": "114.84",
"data_read_per_join": "175K"
},
"used_columns": [
"category_id",
"lang_code",
"category"
]
}
},
{
"table": {
"table_name": "pc",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"pt",
"idx_pc_product_id_type"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"dev2.c.category_id"
],
"rows_examined_per_scan": 101,
"rows_produced_per_join": 4127,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "13.48",
"eval_cost": "412.78",
"prefix_cost": "541.11",
"data_read_per_join": "64K"
},
"used_columns": [
"product_id",
"category_id"
]
}
},
{
"table": {
"table_name": "p",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"status",
"cscart_products_product_id_index",
"idx_status"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"dev2.pc.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 298,
"filtered": "7.22",
"cost_info": {
"read_cost": "1031.95",
"eval_cost": "29.81",
"prefix_cost": "1985.84",
"data_read_per_join": "2M"
},
"used_columns": [
"product_id",
"status",
"company_id"
],
"attached_condition": "((`dev2`.`p`.`company_id` = 692) and (`dev2`.`p`.`status` = 'A'))"
}
}
]
}
}
}
Result
category_id |
category |
products_count |
700 |
Вакуумные машины |
6 |
659 |
Бортовые автомобили с КМУ |
1 |