Query time 0.00163
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "59.51"
},
"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": 70,
"rows_produced_per_join": 70,
"filtered": "100.00",
"index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`cscart_products_categories`.`product_id` in (4975,4974,2432,8485,8484,8483,2459,8492,8491,8493,1532,8502,8501,8499))",
"cost_info": {
"read_cost": "28.01",
"eval_cost": "7.00",
"prefix_cost": "35.01",
"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": "17.50",
"eval_cost": "0.35",
"prefix_cost": "59.51",
"data_read_per_join": "10K"
},
"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 |
| 1532 |
454,453,372,174,166,190M |
| 2432 |
372,174,166,453,454,190M |
| 2459 |
372,166,453,454,174,190M |
| 4974 |
372,552,556,553,250,554M |
| 4975 |
553,556,552,372,250,554M |
| 8483 |
454,166,372,453,174,190M |
| 8484 |
453,174,454,166,372,190M |
| 8485 |
453,174,454,166,372,190M |
| 8491 |
174,454,166,453,372,190M |
| 8492 |
174,454,166,453,372,190M |
| 8493 |
174,454,166,453,372,190M |
| 8499 |
174,454,166,453,372,190M |
| 8501 |
372,453,166,174,454,190M |
| 8502 |
372,174,454,453,166,190M |