Query time 0.00183
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "58.33"
},
"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": 64,
"rows_produced_per_join": 64,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (621,860,619,861,5653,59,122,5662,61,2992,5663,123,63,58,121,124,62,785,784,786,782,787,783,1511))",
"cost_info": {
"read_cost": "28.41",
"eval_cost": "6.40",
"prefix_cost": "34.81",
"data_read_per_join": "1024"
},
"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": [
"dbggbern.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 3,
"filtered": "5.00",
"cost_info": {
"read_cost": "16.00",
"eval_cost": "0.32",
"prefix_cost": "57.21",
"data_read_per_join": "12K"
},
"used_columns": [
"category_id",
"usergroup_ids",
"status",
"storefront_id"
],
"attached_condition": "((`dbggbern`.`cscart_categories`.`storefront_id` in (0,1)) and ((`dbggbern`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`dbggbern`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`dbggbern`.`cscart_categories`.`usergroup_ids`))) and (`dbggbern`.`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",
"dbggbern.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 3,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.80",
"eval_cost": "0.32",
"prefix_cost": "58.33",
"data_read_per_join": "51"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 58 |
24,182,8M |
|
| 59 |
182,24,8M |
|
| 61 |
182,24,8M |
|
| 62 |
182,24,8M |
|
| 63 |
182,24,8M |
|
| 121 |
8,24,182,7M |
0 |
| 122 |
8,24,182,7M |
0 |
| 123 |
8,24,182,7M |
0 |
| 124 |
182,24,8M |
|
| 619 |
183,7,8M |
0 |
| 621 |
183,7,8M |
0 |
| 782 |
24,39,7M |
0 |
| 783 |
39,7M |
0 |
| 784 |
39,7M |
0 |
| 785 |
39,7M |
0 |
| 786 |
39,7M |
0 |
| 787 |
39,7M |
0 |
| 860 |
7,183,8M |
0 |
| 861 |
7,183,8M |
0 |
| 1511 |
39,7M |
0 |
| 2992 |
182,24,184,8M |
|
| 5653 |
182,24,8,7M |
0 |
| 5662 |
8,182,24,7M |
0 |
| 5663 |
8,182,24,7M |
0 |