Query time 0.00088
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "64.39"
},
"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": 27,
"rows_produced_per_join": 27,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "3.74",
"eval_cost": "2.70",
"prefix_cost": "6.44",
"data_read_per_join": "432"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`maniamall_cscart`.`cscart_products_categories`.`product_id` in (1232953,1232965,1232946,1232966,1232947,1232999,1233001,1233004,1233005,1233011,1233008,1233012,1233020))"
}
},
{
"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": 27,
"filtered": "100.00",
"cost_info": {
"read_cost": "26.90",
"eval_cost": "2.70",
"prefix_cost": "36.04",
"data_read_per_join": "432"
},
"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": 1,
"filtered": "5.00",
"cost_info": {
"read_cost": "25.65",
"eval_cost": "0.14",
"prefix_cost": "64.39",
"data_read_per_join": "3K"
},
"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 |
| 1232946 |
4528,16840M |
0 |
| 1232947 |
4528,42632,16840M |
0 |
| 1232953 |
4528,42632,16840M |
0 |
| 1232965 |
4528,16840M |
0 |
| 1232966 |
4528,42632,16840M |
0 |
| 1232999 |
42632,16840M |
0 |
| 1233001 |
42632,16840M |
0 |
| 1233004 |
42632,16840M |
0 |
| 1233005 |
42632,16840M |
0 |
| 1233008 |
42632,16840M |
0 |
| 1233011 |
42632,16840M |
0 |
| 1233012 |
16840M |
0 |
| 1233020 |
16840M |
0 |