Query time 0.00134
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "45.96"
},
"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": 54,
"rows_produced_per_join": 54,
"filtered": "100.00",
"index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`cscart_products_categories`.`product_id` in (4975,4974,4998,4995,5039,5038,4991,5309,5331,5332,5346))",
"cost_info": {
"read_cost": "21.66",
"eval_cost": "5.40",
"prefix_cost": "27.06",
"data_read_per_join": "864"
},
"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": 2,
"filtered": "5.00",
"cost_info": {
"read_cost": "13.50",
"eval_cost": "0.27",
"prefix_cost": "45.96",
"data_read_per_join": "8K"
},
"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 |
| 4974 |
372,552,556,553,250,554M |
| 4975 |
553,556,552,372,250,554M |
| 4991 |
552,554,553,372,250,556M |
| 4995 |
552,553,554,372,250,556M |
| 4998 |
250,552,553,554,372,556M |
| 5038 |
372,553,554,552,250,556M |
| 5039 |
372,553,554,552,250,556M |
| 5309 |
554,553,250,372,552,556M |
| 5331 |
552,250,553,554,372,556M |
| 5332 |
552,250,553,554,372,556M |
| 5346 |
554,553,250,372,552,556M |