Query time 0.04240
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "1151.51"
},
"ordering_operation": {
"using_temporary_table": true,
"using_filesort": true,
"nested_loop": [
{
"table": {
"table_name": "categories",
"access_type": "ref",
"possible_keys": [
"c_status",
"index_categories_on_deleted_at"
],
"key": "index_categories_on_deleted_at",
"used_key_parts": [
"deleted_at"
],
"key_length": "6",
"ref": [
"const"
],
"rows_examined_per_scan": 10182,
"rows_produced_per_join": 33,
"filtered": "0.33",
"index_condition": "(`goimagine`.`categories`.`deleted_at` is null)",
"cost_info": {
"read_cost": "120.75",
"eval_cost": "3.39",
"prefix_cost": "1138.95",
"data_read_per_join": "88K"
},
"used_columns": [
"category_id",
"parent_id",
"id_path",
"level",
"company_id",
"usergroup_ids",
"status",
"position",
"is_trash",
"deleted_at"
],
"attached_condition": "((`goimagine`.`categories`.`company_id` = 1011) and ((`goimagine`.`categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`goimagine`.`categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`goimagine`.`categories`.`usergroup_ids`))) and (`goimagine`.`categories`.`status` = 'A') and (`goimagine`.`categories`.`level` <= 3))"
}
},
{
"table": {
"table_name": "category_descriptions",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id",
"lang_code"
],
"key_length": "9",
"ref": [
"goimagine.categories.category_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 33,
"filtered": "100.00",
"cost_info": {
"read_cost": "9.16",
"eval_cost": "3.39",
"prefix_cost": "1151.51",
"data_read_per_join": "154K"
},
"used_columns": [
"category_id",
"lang_code",
"category"
]
}
}
]
}
}
}
Result
| category_id |
parent_id |
id_path |
category |
position |
status |
company_id |
| 5150 |
1400 |
1400/5150 |
Christmas Cards |
0 |
A |
1011 |
| 5144 |
1400 |
1400/5144 |
Decor |
0 |
A |
1011 |
| 4479 |
4473 |
4473/4479 |
Decor |
0 |
A |
1011 |
| 4476 |
1399 |
1399/4476 |
Decor |
0 |
A |
1011 |
| 2587 |
2586 |
2586/2587 |
Décor |
0 |
A |
1011 |
| 4481 |
4473 |
4473/4481 |
Drinkware |
0 |
A |
1011 |
| 5146 |
1400 |
1400/5146 |
Drinkware |
0 |
A |
1011 |
| 4478 |
1399 |
1399/4478 |
Drinkware |
0 |
A |
1011 |
| 5147 |
1400 |
1400/5147 |
Gifts |
0 |
A |
1011 |
| 4480 |
4473 |
4473/4480 |
Shirts |
0 |
A |
1011 |
| 5145 |
1400 |
1400/5145 |
Shirts |
0 |
A |
1011 |
| 4477 |
1399 |
1399/4477 |
Shirts |
0 |
A |
1011 |
| 5148 |
1400 |
1400/5148 |
Stocking Stuffers |
0 |
A |
1011 |
| 2586 |
0 |
2586 |
Easter |
1 |
A |
1011 |
| 1399 |
0 |
1399 |
Fall Finds |
2 |
A |
1011 |
| 1400 |
0 |
1400 |
Christmas |
3 |
A |
1011 |
| 4473 |
0 |
4473 |
Halloween |
4 |
A |
1011 |
| 3876 |
0 |
3876 |
Gifts for Dad |
5 |
A |
1011 |
| 3665 |
0 |
3665 |
Teacher Gifts |
6 |
A |
1011 |
| 2884 |
0 |
2884 |
Gifts for Mom |
7 |
A |
1011 |
| 795 |
0 |
795 |
Soy Wax Melts |
8 |
A |
1011 |
| 1552 |
0 |
1552 |
St. Patrick's Day |
9 |
A |
1011 |
| 23123 |
0 |
23123 |
Graduation Gifts |
10 |
A |
1011 |
| 1396 |
0 |
1396 |
Body Pampering |
11 |
A |
1011 |
| 5149 |
0 |
5149 |
Kitchen Essentials |
12 |
A |
1011 |
| 567 |
0 |
567 |
Southern Drinkware |
13 |
A |
1011 |
| 3666 |
0 |
3666 |
Patriotic July 4th Gear |
15 |
A |
1011 |
| 20810 |
0 |
20810 |
Spring Décor and Gifts |
16 |
A |
1011 |
| 588 |
0 |
588 |
Mason Jar Soy Candles |
17 |
A |
1011 |
| 1375 |
0 |
1375 |
Valentine's Gifts and Décor |
18 |
A |
1011 |
| 3440 |
0 |
3440 |
Southern Farmhouse Décor |
19 |
A |
1011 |