Query time 0.00178
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "62.41"
},
"grouping_operation": {
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "pt",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"rows_examined_per_scan": 73,
"rows_produced_per_join": 73,
"filtered": "100.00",
"index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`cscart_products_categories`.`product_id` in (2393,2394,3464,3467,3826,4101,4192,4193,4975,4974,4998,4995,5900,5899,5934,5935))",
"cost_info": {
"read_cost": "29.56",
"eval_cost": "7.30",
"prefix_cost": "36.86",
"data_read_per_join": "1K"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
]
}
},
{
"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": [
"softwarepirmam_hewadelivard_cscart_4.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 3,
"filtered": "5.00",
"cost_info": {
"read_cost": "18.25",
"eval_cost": "0.37",
"prefix_cost": "62.41",
"data_read_per_join": "11K"
},
"used_columns": [
"category_id",
"storefront_id",
"usergroup_ids",
"status"
],
"attached_condition": "((`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`storefront_id` in (0,1)) and ((`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`usergroup_ids`))) and (`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`status` in ('A','H')))"
}
}
]
}
}
}
Result
| product_id |
category_ids |
| 2393 |
308,350,386,250,166,382M |
| 2394 |
386,250,350,308,166,382M |
| 3464 |
458,250,251M |
| 3467 |
458,250,251M |
| 3826 |
250,166,401,351,446M |
| 4101 |
166,351,401,250,446M |
| 4192 |
166,350,250,308,386,382M |
| 4193 |
386,308,250,350,166,382M |
| 4974 |
372,552,556,553,250,554M |
| 4975 |
553,556,552,372,250,554M |
| 4995 |
552,553,554,372,250,556M |
| 4998 |
250,552,553,554,372,556M |
| 5899 |
308,250,350,166,386,382M |
| 5900 |
350,166,250,386,308,382M |
| 5934 |
250,308,350,423,166,386,382M |
| 5935 |
423,166,350,386,308,250,382M |