Query time 0.00177
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "51.61"
},
"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": 57,
"rows_produced_per_join": 57,
"filtered": "100.00",
"index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`cscart_products_categories`.`product_id` in (5243,5231,5453,5010,5018,5802,6383,6407,7580,5491,5971,2439,5841,5292,10138,2894,2905,6451,2891,2893))",
"cost_info": {
"read_cost": "24.96",
"eval_cost": "5.70",
"prefix_cost": "30.66",
"data_read_per_join": "912"
},
"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": "14.25",
"eval_cost": "0.29",
"prefix_cost": "50.61",
"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')))"
}
},
{
"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": 2,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.71",
"eval_cost": "0.29",
"prefix_cost": "51.61",
"data_read_per_join": "45"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 2439 |
454,453,166,372,174,190M |
0 |
| 2891 |
372,384,459M |
0 |
| 2893 |
384,372,459M |
0 |
| 2894 |
384,372,459M |
0 |
| 2905 |
461,372,465M |
0 |
| 5010 |
561,555,557,552,553,372,250,563M |
0 |
| 5018 |
561,555,557,552,553,372,250,563M |
0 |
| 5231 |
372,550M |
0 |
| 5243 |
372,549M |
0 |
| 5292 |
372,552,550M |
0 |
| 5453 |
466,372,574M |
0 |
| 5491 |
466,372,575M |
0 |
| 5802 |
372,583M |
0 |
| 5841 |
372,583M |
0 |
| 5971 |
454,190M |
|
| 6383 |
372,583M |
0 |
| 6407 |
566,372,595M |
0 |
| 6451 |
174,453,372,166,454,190M |
0 |
| 7580 |
461M |
|
| 10138 |
372,454,453,190,174,166M |
0 |