Query time 0.00145
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "49.20"
},
"grouping_operation": {
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"link_type",
"pt"
],
"key": "pt",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"rows_examined_per_scan": 53,
"rows_produced_per_join": 53,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "5.72",
"eval_cost": "5.30",
"prefix_cost": "11.02",
"data_read_per_join": "848"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`cscart_db`.`cscart_products_categories`.`product_id` in (5228,7268,9457,9469,13620,13793,13797,13885,13909,14841,14842,15236,15499,18040,18063,18067,18071,18075,21958,21962,21963,26972,30028,30037))"
}
},
{
"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",
"cscart_db.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 53,
"filtered": "100.00",
"cost_info": {
"read_cost": "14.33",
"eval_cost": "5.30",
"prefix_cost": "30.65",
"data_read_per_join": "848"
},
"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": [
"cscart_db.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 2,
"filtered": "5.00",
"cost_info": {
"read_cost": "13.25",
"eval_cost": "0.27",
"prefix_cost": "49.20",
"data_read_per_join": "7K"
},
"used_columns": [
"category_id",
"usergroup_ids",
"status",
"storefront_id"
],
"attached_condition": "((`cscart_db`.`cscart_categories`.`storefront_id` in (0,1)) and ((`cscart_db`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`cscart_db`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`cscart_db`.`cscart_categories`.`usergroup_ids`))) and (`cscart_db`.`cscart_categories`.`status` in ('A','H')))"
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 5228 |
2332,2819M |
0 |
| 7268 |
2332,2812M |
0 |
| 9457 |
2332,2812M |
0 |
| 9469 |
2332,2812M |
0 |
| 13620 |
2332,2819M |
0 |
| 13793 |
2332,2309M |
0 |
| 13797 |
2332,2309M |
0 |
| 13885 |
2332,2819M |
0 |
| 13909 |
2332,2819M |
0 |
| 14841 |
2327,2332,2811,2819M |
0 |
| 14842 |
2332,2812M |
0 |
| 15236 |
2332,2819M |
0 |
| 15499 |
2332,2812M |
0 |
| 18040 |
2332,2819M |
0 |
| 18063 |
2332,2819M |
0 |
| 18067 |
2332,2819M |
0 |
| 18071 |
2332,2819M |
0 |
| 18075 |
2332,2819M |
0 |
| 21958 |
2332,2812M |
0 |
| 21962 |
2332,2363,2821M |
0 |
| 21963 |
2332,2812M |
0 |
| 26972 |
2332,2812M |
0 |
| 30028 |
2332,2819M |
0 |
| 30037 |
2332,2819M |
0 |