Query time 0.00219
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "74.68"
},
"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": 84,
"rows_produced_per_join": 84,
"filtered": "100.00",
"index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`cscart_products_categories`.`product_id` in (5396,5581,5021,5022,5006,5853,4961,5009,5318,5558,2890,5208,5449,5556,5792,10403,5519,5601,5901,7772,8266,5763,2888,5241))",
"cost_info": {
"read_cost": "35.41",
"eval_cost": "8.40",
"prefix_cost": "43.81",
"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.00",
"eval_cost": "0.42",
"prefix_cost": "73.21",
"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.05",
"eval_cost": "0.42",
"prefix_cost": "74.68",
"data_read_per_join": "67"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 2888 |
372,384,459M |
0 |
| 2890 |
372,384,459M |
0 |
| 4961 |
556,552,372,553,250,554M |
0 |
| 5006 |
561,555,557,552,553,372,250,563M |
0 |
| 5009 |
561,555,557,552,553,372,250,563M |
0 |
| 5021 |
561,555,557,552,553,372,250,563M |
0 |
| 5022 |
561,555,557,552,553,372,250,563M |
0 |
| 5208 |
372,557,555,553,552,250,563,561M |
0 |
| 5241 |
372,549M |
0 |
| 5318 |
372,552,550M |
0 |
| 5396 |
372,250,553,554,552,556M |
0 |
| 5449 |
466,372,574M |
0 |
| 5519 |
466,372,573M |
0 |
| 5556 |
466,372,581M |
0 |
| 5558 |
466,372,581M |
0 |
| 5581 |
572,372,582M |
0 |
| 5601 |
466,372,573M |
0 |
| 5763 |
572,372,582M |
0 |
| 5792 |
466,372,579M |
0 |
| 5853 |
372,583M |
0 |
| 5901 |
566,372,595M |
0 |
| 7772 |
556M |
|
| 8266 |
454,190M |
|
| 10403 |
384M |
|