Query time 0.00075
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "31.90"
},
"nested_loop": [
{
"table": {
"table_name": "c",
"access_type": "ALL",
"rows_examined_per_scan": 125,
"rows_produced_per_join": 0,
"filtered": "0.80",
"cost_info": {
"read_cost": "30.29",
"eval_cost": "0.20",
"prefix_cost": "30.49",
"data_read_per_join": "4K"
},
"used_columns": [
"category_id",
"parent_id",
"id_path",
"level",
"company_id",
"status"
],
"attached_condition": "((`cscart`.`c`.`company_id` = 0) and (`cscart`.`c`.`id_path` like '%303%') and (`cscart`.`c`.`status` = 'A'))"
}
},
{
"table": {
"table_name": "sm",
"access_type": "ref",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"cscart.c.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.21",
"eval_cost": "0.20",
"prefix_cost": "31.90",
"data_read_per_join": "31"
},
"used_columns": [
"category_id",
"lang_code",
"search_phrases"
],
"attached_condition": "(<if>(found_match(sm), ((`cscart`.`sm`.`search_phrases` <> 'NULL') or (`cscart`.`c`.`level` = (/* select#2 */ select '1' from `cscart`.`cscart_categories` where 1))), true) and <if>(is_not_null_compl(sm), (`cscart`.`sm`.`lang_code` = 'ru'), true))",
"attached_subqueries": [
{
"dependent": false,
"cacheable": true,
"query_block": {
"select_id": 2,
"cost_info": {
"query_cost": "1.00"
},
"table": {
"table_name": "cscart_categories",
"access_type": "const",
"possible_keys": [
"PRIMARY",
"p_category_id"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.20",
"prefix_cost": "0.00",
"data_read_per_join": "4K"
},
"used_columns": [
"category_id",
"level"
]
}
}
}
]
}
}
]
}
}
Result
| parent_id |
search_phrases |
category_id |
| 303 |
|
305 |
| 0 |
|
303 |
| 303 |
|
304 |
| 303 |
|
314 |
| 303 |
|
315 |
| 303 |
|
316 |
| 315 |
|
317 |
| 315 |
|
318 |
| 315 |
|
319 |
| 316 |
|
320 |
| 316 |
|
321 |
| 304 |
|
322 |
| 304 |
|
325 |
| 304 |
|
326 |
| 305 |
|
327 |
| 305 |
|
328 |
| 305 |
|
329 |
| 314 |
|
330 |
| 314 |
|
331 |
| 314 |
|
332 |