Query time 0.00271
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "128.91"
},
"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": 143,
"rows_produced_per_join": 143,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (104,2593,2711,2710,2693,2709,2976,2735,2694,3187,2990,4735,2991,2989,863,1478,1479,781,862,3175,7926,1480,1482,2446,1481,6430,6431,7254,7255,4050,4051,4602,4049,4034,4048,4419,4601,4422,4418,4421,4420,4423,4600,5961,5960,5958,5959,5213))",
"cost_info": {
"read_cost": "62.06",
"eval_cost": "14.30",
"prefix_cost": "76.36",
"data_read_per_join": "2K"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
]
}
},
{
"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": 7,
"filtered": "5.00",
"cost_info": {
"read_cost": "35.75",
"eval_cost": "0.72",
"prefix_cost": "126.41",
"data_read_per_join": "28K"
},
"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')))"
}
},
{
"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": 7,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.79",
"eval_cost": "0.72",
"prefix_cost": "128.91",
"data_read_per_join": "114"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 104 |
24,28M |
|
| 781 |
24,16,7M |
0 |
| 862 |
16,24M |
|
| 863 |
24,16,7M |
0 |
| 1478 |
16M |
|
| 1479 |
16M |
|
| 1480 |
24,16,7M |
0 |
| 1481 |
24,16,7M |
0 |
| 1482 |
24,16,7M |
0 |
| 2446 |
24,16,7M |
0 |
| 2593 |
24,16,7M |
0 |
| 2693 |
16,24,7M |
0 |
| 2694 |
24,16,7M |
0 |
| 2709 |
24,16,7M |
0 |
| 2710 |
24,16,7M |
0 |
| 2711 |
16,24,7M |
0 |
| 2735 |
24,16,7M |
0 |
| 2976 |
24,16,7M |
0 |
| 2989 |
24,16,7M |
0 |
| 2990 |
24,7,16M |
0 |
| 2991 |
16,24M |
|
| 3175 |
24,16,39,7M |
0 |
| 3187 |
24,16,7M |
0 |
| 4034 |
39,9,24,7M |
0 |
| 4048 |
7,9,39,24M |
0 |
| 4049 |
39,9,24,7M |
0 |
| 4050 |
7,9,39,24M |
0 |
| 4051 |
39,9,24,7M |
0 |
| 4418 |
24,9M |
|
| 4419 |
24,9M |
|
| 4420 |
24,9M |
|
| 4421 |
9,24,7M |
0 |
| 4422 |
24,9M |
|
| 4423 |
24,9M |
|
| 4600 |
24,9M |
|
| 4601 |
24,9M |
|
| 4602 |
39,9,24,7M |
0 |
| 4735 |
16,24,7M |
0 |
| 5213 |
8,184,183,24,7M |
0 |
| 5958 |
24,9,7M |
0 |
| 5959 |
9,24,7M |
0 |
| 5960 |
9,24,7M |
0 |
| 5961 |
24,9,7M |
0 |
| 6430 |
9,24,7,558,1M |
0 |
| 6431 |
9,24,7,558,1M |
0 |
| 7254 |
9,24,585,7M |
0 |
| 7255 |
9,24,585,7M |
0 |
| 7926 |
39,24,16,7M |
0 |