Query time 0.00206
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "77.13"
},
"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": 87,
"rows_produced_per_join": 87,
"filtered": "100.00",
"index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`cscart_products_categories`.`product_id` in (5362,5489,5573,5793,8718,8719,5428,5524,5540,5591,8715,10197,5226,5300,5466,5511,5867,6590,5495,5907,5570,5771,5260,5642))",
"cost_info": {
"read_cost": "36.46",
"eval_cost": "8.70",
"prefix_cost": "45.16",
"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": 4,
"filtered": "5.00",
"cost_info": {
"read_cost": "21.75",
"eval_cost": "0.44",
"prefix_cost": "75.61",
"data_read_per_join": "13K"
},
"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')))"
}
},
{
"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",
"softwarepirmam_hewadelivard_cscart_4.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 4,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.09",
"eval_cost": "0.44",
"prefix_cost": "77.13",
"data_read_per_join": "69"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 5226 |
372,550M |
0 |
| 5260 |
250,372,557,555,562,553,552,560M |
0 |
| 5300 |
372,552,550M |
0 |
| 5362 |
372,552,550M |
0 |
| 5428 |
466,372,574M |
0 |
| 5466 |
250,372,553,552,554,556M |
0 |
| 5489 |
466,372,575M |
0 |
| 5495 |
466,372,575M |
0 |
| 5511 |
466,372,573M |
0 |
| 5524 |
466,372,576M |
0 |
| 5540 |
250,372,560,553,555,552,557,562M |
0 |
| 5570 |
555,553,250,560,557,552,372,562M |
0 |
| 5573 |
562,250,555,553,557,552,372,560M |
0 |
| 5591 |
466,372,573M |
0 |
| 5642 |
553,555,250,560,557,552,372,562M |
0 |
| 5771 |
372,583M |
0 |
| 5793 |
466,372,579M |
0 |
| 5867 |
572,372,582M |
0 |
| 5907 |
595M |
|
| 6590 |
174,453,372,166,454,190M |
0 |
| 8715 |
166,453,454,372,174,190M |
0 |
| 8718 |
166,453,454,372,174,190M |
0 |
| 8719 |
166,453,454,372,174,190M |
0 |
| 10197 |
463M |
|