Query time 0.00256
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "38.94"
},
"nested_loop": [
{
"table": {
"table_name": "c",
"access_type": "ALL",
"rows_examined_per_scan": 347,
"rows_produced_per_join": 0,
"filtered": "0.29",
"cost_info": {
"read_cost": "37.44",
"eval_cost": "0.10",
"prefix_cost": "37.54",
"data_read_per_join": "3K"
},
"used_columns": [
"category_id",
"parent_id",
"id_path",
"level",
"company_id",
"status"
],
"attached_condition": "((`softwarepirmam_hewadelivard_cscart_4`.`c`.`company_id` = 0) and (`softwarepirmam_hewadelivard_cscart_4`.`c`.`id_path` like '%166%') and (`softwarepirmam_hewadelivard_cscart_4`.`c`.`status` = 'A'))"
}
},
{
"table": {
"table_name": "sm",
"access_type": "ref",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"softwarepirmam_hewadelivard_cscart_4.c.category_id"
],
"rows_examined_per_scan": 4,
"rows_produced_per_join": 3,
"filtered": "100.00",
"index_condition": "<if>(is_not_null_compl(sm), (`softwarepirmam_hewadelivard_cscart_4`.`sm`.`lang_code` = 'ar'), true)",
"cost_info": {
"read_cost": "1.00",
"eval_cost": "0.40",
"prefix_cost": "38.94",
"data_read_per_join": "127"
},
"used_columns": [
"category_id",
"lang_code",
"search_phrases"
],
"attached_condition": "<if>(found_match(sm), ((`softwarepirmam_hewadelivard_cscart_4`.`sm`.`search_phrases` <> 'NULL') or (`softwarepirmam_hewadelivard_cscart_4`.`c`.`level` = (/* select#2 */ select '1' from `softwarepirmam_hewadelivard_cscart_4`.`cscart_categories` where true))), 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.10",
"prefix_cost": "0.00",
"data_read_per_join": "3K"
},
"used_columns": [
"category_id",
"level"
]
}
}
}
]
}
}
]
}
}
Result
| parent_id |
search_phrases |
category_id |
| 0 |
|
166 |
| 174 |
|
190 |
| 350 |
|
381 |
| 166 |
|
167 |
| 328 |
|
341 |
| 359 |
|
360 |
| 342 |
|
362 |
| 424 |
|
450 |
| 350 |
|
382 |
| 174 |
|
337 |
| 328 |
|
342 |
| 359 |
|
361 |
| 342 |
|
363 |
| 423 |
|
424 |
| 424 |
|
451 |
| 166 |
|
234 |
| 350 |
|
383 |
| 543 |
|
343 |
| 423 |
|
425 |
| 351 |
|
430 |
| 424 |
|
452 |
| 174 |
|
486 |
| 166 |
|
170 |
| 166 |
|
320 |
| 328 |
|
359 |
| 424 |
|
426 |
| 543 |
|
544 |
| 166 |
|
174 |
| 166 |
|
322 |
| 328 |
|
364 |
| 329 |
|
399 |
| 351 |
|
446 |
| 329 |
|
457 |
| 166 |
|
328 |
| 328 |
|
366 |
| 423 |
|
448 |
| 329 |
|
347 |
| 423 |
|
477 |
| 166 |
|
329 |
| 328 |
|
438 |
| 423 |
|
449 |
| 328 |
|
481 |
| 424 |
|
492 |
| 423 |
|
520 |
| 166 |
|
350 |
| 166 |
|
351 |
| 399 |
|
523 |
| 399 |
|
524 |
| 328 |
|
543 |
| 166 |
|
378 |
| 328 |
|
564 |
| 166 |
|
423 |