Query time 0.00289
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "68.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": 77,
"rows_produced_per_join": 77,
"filtered": "100.00",
"index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`cscart_products_categories`.`product_id` in (8492,2899,5288,8487,5523,7614,5666,6823,8503,8505,5968,7613,8496,8489,5179,5263,5920,7248,7615,7492,5665,2465,2784,7290))",
"cost_info": {
"read_cost": "32.96",
"eval_cost": "7.70",
"prefix_cost": "40.66",
"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": 3,
"filtered": "5.00",
"cost_info": {
"read_cost": "19.25",
"eval_cost": "0.39",
"prefix_cost": "67.61",
"data_read_per_join": "12K"
},
"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": 3,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.96",
"eval_cost": "0.39",
"prefix_cost": "68.96",
"data_read_per_join": "61"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 2465 |
174,453,454,166,372,190M |
0 |
| 2784 |
372,461,464M |
0 |
| 2899 |
372,384,460M |
0 |
| 5179 |
563,557,555,250,372,553,552,561M |
0 |
| 5263 |
563,553,555,557,372,250,552,561M |
0 |
| 5288 |
250,372,563,557,555,553,552,561M |
0 |
| 5523 |
466,372,573M |
0 |
| 5665 |
372,587M |
0 |
| 5666 |
372,587M |
0 |
| 5920 |
584M |
|
| 5968 |
593M |
|
| 6823 |
554,556M |
|
| 7248 |
454,190M |
|
| 7290 |
190,454M |
|
| 7492 |
583M |
|
| 7613 |
454,190M |
|
| 7614 |
454,190M |
|
| 7615 |
454,190M |
|
| 8487 |
166,453,174,372,454,190M |
0 |
| 8489 |
372,174,454,166,453,190M |
0 |
| 8492 |
174,454,166,453,372,190M |
0 |
| 8496 |
372,453,454,166,174,190M |
0 |
| 8503 |
372,166,453,174,454,190M |
0 |
| 8505 |
174,454,372,166,453,190M |
0 |