Query time 0.00157
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "200.61"
},
"grouping_operation": {
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "pt",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"rows_examined_per_scan": 164,
"rows_produced_per_join": 164,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (4147,2918,4148,2917,2684,7585,3354,2896,3353,2434,2435,2436,3803,1858,1857,1856,1855,5706,5130,5129,7077,6341,5516,5197,7841,3927,3926,3932,1860,2471,5445,5446,3538,3539,1528,1527,4660,4659,4486,4658,6698,2217,2342,2218,3104,3117,7215,6973))",
"cost_info": {
"read_cost": "69.41",
"eval_cost": "16.40",
"prefix_cost": "85.81",
"data_read_per_join": "2K"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
]
}
},
{
"table": {
"table_name": "product_position_source",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id",
"product_id"
],
"key_length": "6",
"ref": [
"const",
"dbggbern.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 164,
"filtered": "100.00",
"cost_info": {
"read_cost": "41.00",
"eval_cost": "16.40",
"prefix_cost": "143.21",
"data_read_per_join": "2K"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
},
{
"table": {
"table_name": "cscart_categories",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"dbggbern.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 8,
"filtered": "5.00",
"cost_info": {
"read_cost": "41.00",
"eval_cost": "0.82",
"prefix_cost": "200.61",
"data_read_per_join": "32K"
},
"used_columns": [
"category_id",
"usergroup_ids",
"status",
"storefront_id"
],
"attached_condition": "((`dbggbern`.`cscart_categories`.`storefront_id` in (0,1)) and ((`dbggbern`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`dbggbern`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`dbggbern`.`cscart_categories`.`usergroup_ids`))) and (`dbggbern`.`cscart_categories`.`status` in ('A','H')))"
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 1527 |
116,59,158M |
0 |
| 1528 |
117,59,158M |
0 |
| 1855 |
274,182,59,8,7M |
0 |
| 1856 |
274,182,59,8,7M |
0 |
| 1857 |
274,182,59,8,7M |
0 |
| 1858 |
274,182,59,8,7M |
0 |
| 1860 |
118,59M |
0 |
| 2217 |
222,116,59M |
0 |
| 2218 |
117,222,59M |
0 |
| 2342 |
222,116,59M |
0 |
| 2434 |
274,182,59,8,7M |
0 |
| 2435 |
274,182,59,8,7M |
0 |
| 2436 |
274,182,59,8,7M |
0 |
| 2471 |
167,59M |
0 |
| 2684 |
274,182,59,8,7M |
0 |
| 2896 |
274,8,182,59M |
0 |
| 2917 |
8,7,182,274,25M |
|
| 2918 |
7,25,274,182,8M |
|
| 3104 |
297,276,116,59M |
0 |
| 3117 |
117,297,59M |
0 |
| 3353 |
274,182,59,8,7M |
0 |
| 3354 |
274,182,59,8,7M |
0 |
| 3538 |
341,116,59M |
0 |
| 3539 |
341,116,59M |
0 |
| 3803 |
8,274,182,7M |
|
| 3926 |
368,276,116,59M |
0 |
| 3927 |
368,116,59M |
0 |
| 3932 |
117,368,59M |
0 |
| 4147 |
25,59,8,349M |
0 |
| 4148 |
8,25,59,349M |
0 |
| 4486 |
414,116,59M |
0 |
| 4658 |
414,116,59M |
0 |
| 4659 |
117,414,59M |
0 |
| 4660 |
414,276,117,59M |
0 |
| 5129 |
274,7,182,349,25,59M |
0 |
| 5130 |
274,7,182,349,25,59M |
0 |
| 5197 |
118,59M |
0 |
| 5445 |
496,59M |
0 |
| 5446 |
496,59M |
0 |
| 5516 |
118,59M |
0 |
| 5706 |
59,8,274,349,498,25,7M |
0 |
| 6341 |
118,59M |
0 |
| 6698 |
117,610,59M |
0 |
| 6973 |
633,116,59M |
0 |
| 7077 |
274,7,182,349,25,59M |
0 |
| 7215 |
118,59M |
0 |
| 7585 |
8,274,182,7,349,25M |
|
| 7841 |
118,59M |
0 |