Query time 0.00137
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "81.41"
},
"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": 72,
"rows_produced_per_join": 72,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "8.21",
"eval_cost": "7.20",
"prefix_cost": "15.41",
"data_read_per_join": "1K"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`maniamall_cscart`.`cscart_products_categories`.`product_id` in (1437277,1903062,1128285,480519,447578,522515,241391,1118346,1128289,687122,1129605,897024,447588,1274272,481220,1080078,596382,444124,1108774,697795))"
}
},
{
"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": "58.80",
"eval_cost": "0.36",
"prefix_cost": "81.41",
"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 |
| 241391 |
4528,30755,42632,6354M |
| 444124 |
4528,7159,6942M |
| 447578 |
4528,6638,28651,7168M |
| 447588 |
4528,6578M |
| 480519 |
4528,14541,1571M |
| 481220 |
4528,1700M |
| 522515 |
4528,6765,28627,42630,1328M |
| 596382 |
8619M |
| 687122 |
4528,42631,14966M |
| 697795 |
32420,3288M |
| 897024 |
4528,6793M |
| 1080078 |
4528,2531M |
| 1108774 |
4528,16839,32420,3303M |
| 1118346 |
4528,6638,28651,42632,7168M |
| 1128285 |
4528,5554,28759,5079M |
| 1128289 |
4528,5554,28759,5079M |
| 1129605 |
4528,5554,28759,5079M |
| 1274272 |
4528,28651,42632,5549M |
| 1437277 |
4528,6334,6335,6336,6337,6338,6339,6644,7347,28615,28617M |
| 1903062 |
4528,28615,28617M |