Query time 0.00290
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "117.19"
},
"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": 136,
"rows_produced_per_join": 136,
"filtered": "100.00",
"index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`cscart_products_categories`.`product_id` in (5277,1593,5899,5640,2201,5934,5939,3929,5918,1562,5284,5376,4193,1571,5287,3226,5281,3218,5397,4995,5270,2393,3464,1575))",
"cost_info": {
"read_cost": "53.61",
"eval_cost": "13.60",
"prefix_cost": "67.21",
"data_read_per_join": "2K"
},
"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": 6,
"filtered": "5.00",
"cost_info": {
"read_cost": "34.00",
"eval_cost": "0.68",
"prefix_cost": "114.81",
"data_read_per_join": "21K"
},
"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": 6,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.70",
"eval_cost": "0.68",
"prefix_cost": "117.19",
"data_read_per_join": "108"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 1562 |
411,405,402,342,328,166,363M |
|
| 1571 |
410,405,402,342,328,166,362M |
|
| 1575 |
410,405,402,342,328,166,362M |
|
| 1593 |
410,405,402,342,328,166,362M |
|
| 2201 |
250,166,386,382M |
0 |
| 2393 |
308,350,386,250,166,382M |
0 |
| 3218 |
545,543,568,546,521,250,406,328,402,166,343M |
0 |
| 3226 |
545,543,568,546,521,250,406,328,402,166,343M |
0 |
| 3464 |
458,250,251M |
0 |
| 3929 |
411,405,342,250,402,328,166,363M |
0 |
| 4193 |
386,308,250,350,166,382M |
0 |
| 4995 |
552,553,554,372,250,556M |
0 |
| 5270 |
250,372,563,557,555,553,552,561M |
0 |
| 5277 |
250,372,563,557,555,553,552,561M |
0 |
| 5281 |
250,372,563,557,555,553,552,561M |
0 |
| 5284 |
400,372,563,557,555,553,552,561M |
|
| 5287 |
372,250,563,557,555,553,552,561M |
0 |
| 5376 |
372,250,553,552,554,556M |
0 |
| 5397 |
372,250,553,554,552,556M |
0 |
| 5640 |
555,553,250,560,557,552,372,562M |
0 |
| 5899 |
308,250,350,166,386,382M |
0 |
| 5918 |
404,402,250,328,166,341M |
0 |
| 5934 |
250,308,350,423,166,386,382M |
0 |
| 5939 |
402,250,341,328,166,404M |
0 |