Query time 0.00280
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "157.76"
},
"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": 71,
"rows_produced_per_join": 71,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "8.03",
"eval_cost": "7.10",
"prefix_cost": "15.13",
"data_read_per_join": "1K"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`maniamall_cscart`.`cscart_products_categories`.`product_id` in (1198929,1198866,1700019,1129867,1129865,1198921,1231457,1629454,1231084,1877559,1214595,1231474,1231195,2253669,1232266,1629453,1346809,1232184,1231494,1231498,1162349,1231458,1129873,1231612,1231377,1346810,1232049,1162628,1231459,1198907,1232064,1231569))"
}
},
{
"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": 71,
"filtered": "100.00",
"cost_info": {
"read_cost": "70.45",
"eval_cost": "7.10",
"prefix_cost": "92.67",
"data_read_per_join": "1K"
},
"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": [
"maniamall_cscart.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 3,
"filtered": "5.00",
"cost_info": {
"read_cost": "57.98",
"eval_cost": "0.36",
"prefix_cost": "157.76",
"data_read_per_join": "9K"
},
"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')))"
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 1129865 |
4528,5079M |
|
| 1129867 |
4528,5079M |
|
| 1129873 |
4528,5079M |
|
| 1162349 |
30438M |
|
| 1162628 |
30444M |
|
| 1198866 |
4528,5554,28759,5079M |
|
| 1198907 |
2322M |
|
| 1198921 |
4528,5554,28759,5079M |
|
| 1198929 |
4528,5554,28759,5079M |
|
| 1214595 |
4528,42632,1449M |
|
| 1231084 |
32420,7134M |
|
| 1231195 |
32420,7134M |
|
| 1231377 |
32420,12980M |
|
| 1231457 |
32420,30541M |
|
| 1231458 |
32420,30541M |
|
| 1231459 |
32420,30541M |
|
| 1231474 |
32420,30541M |
|
| 1231494 |
32420,30541M |
|
| 1231498 |
30541M |
|
| 1231569 |
32420,2561M |
|
| 1231612 |
32420,7134M |
|
| 1232049 |
32420,3111M |
|
| 1232064 |
32420,29175M |
|
| 1232184 |
32420,30300M |
|
| 1232266 |
32420,2464M |
|
| 1346809 |
4528,28759M |
|
| 1346810 |
4528,28759M |
|
| 1629453 |
4528,30461M |
|
| 1629454 |
4528,30461M |
|
| 1700019 |
285,2995,4528,5774M |
0 |
| 1877559 |
4528,5167,5083M |
|
| 2253669 |
7168,28651,4528M |
|