Query time 0.00514
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "109.92"
},
"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": 92,
"rows_produced_per_join": 92,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "10.22",
"eval_cost": "9.20",
"prefix_cost": "19.42",
"data_read_per_join": "1K"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`maniamall_cscart`.`cscart_products_categories`.`product_id` in (1232973,1080125,431448,1192887,524883,487140,522508,1302584,522509,1717796,1438105,880662,431449,1717787,1313291,1029048,1903053,525824,1302515,1232965,1232906,1447394,1108255,1346803,1199097,612860,1717795,866430,2055715,1128299,525870,410762))"
}
},
{
"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": [
"maniamall_cscart.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 4,
"filtered": "5.00",
"cost_info": {
"read_cost": "76.67",
"eval_cost": "0.46",
"prefix_cost": "105.29",
"data_read_per_join": "11K"
},
"used_columns": [
"category_id",
"company_id",
"usergroup_ids",
"status"
],
"attached_condition": "((`maniamall_cscart`.`cscart_categories`.`company_id` = 1) and ((`maniamall_cscart`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`maniamall_cscart`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`maniamall_cscart`.`cscart_categories`.`usergroup_ids`))) and (`maniamall_cscart`.`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",
"maniamall_cscart.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 4,
"filtered": "100.00",
"cost_info": {
"read_cost": "4.17",
"eval_cost": "0.46",
"prefix_cost": "109.92",
"data_read_per_join": "73"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 410762 |
4528,42630,7027M |
0 |
| 431448 |
4528,1220M |
0 |
| 431449 |
4528,1220M |
0 |
| 487140 |
4528,5770,2546M |
0 |
| 522508 |
4528,1032M |
0 |
| 522509 |
4528,1032M |
0 |
| 524883 |
1306,4528 |
0 |
| 525824 |
4528,6657M |
0 |
| 525870 |
4528,4496M |
0 |
| 612860 |
32420,3279M |
|
| 866430 |
4528,8329M |
0 |
| 880662 |
2920,4528,42632,8307M |
0 |
| 1029048 |
32420M |
|
| 1080125 |
4528,2530M |
0 |
| 1108255 |
4528,32420,42631,28024M |
0 |
| 1128299 |
4528,5554,28759,5079M |
0 |
| 1192887 |
4528,5706,42631,6578M |
0 |
| 1199097 |
4528,5554,14939,5079M |
0 |
| 1232906 |
4528,16886M |
0 |
| 1232965 |
4528,16840M |
0 |
| 1232973 |
4528,16895M |
0 |
| 1302515 |
4528,6765,28627M |
0 |
| 1302584 |
4528,6765,28627M |
0 |
| 1313291 |
1172,4528,5451,851M |
0 |
| 1346803 |
4528,28759M |
0 |
| 1438105 |
4528,2464M |
0 |
| 1447394 |
4528,6765,28627,1328M |
0 |
| 1717787 |
2461,2530,2629,4528,284M |
0 |
| 1717795 |
2461,2530,2629,4528,284M |
0 |
| 1717796 |
2461,2530,2629,4528,284M |
0 |
| 1903053 |
4528,28617,849M |
0 |
| 2055715 |
4528,5079,912M |
0 |