Query time 0.00058
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "32.44"
},
"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": 36,
"rows_produced_per_join": 36,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (3858,3859,1169,5315,48,49,1171,1166,1167,1204,1172,731))",
"cost_info": {
"read_cost": "15.61",
"eval_cost": "3.60",
"prefix_cost": "19.21",
"data_read_per_join": "576"
},
"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": 1,
"filtered": "5.00",
"cost_info": {
"read_cost": "9.00",
"eval_cost": "0.18",
"prefix_cost": "31.81",
"data_read_per_join": "7K"
},
"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": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.45",
"eval_cost": "0.18",
"prefix_cost": "32.44",
"data_read_per_join": "28"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 48 |
182,25,8M |
|
| 49 |
25,182,8M |
|
| 731 |
182,25,8M |
|
| 1166 |
25,182,8M |
|
| 1167 |
182,25,8M |
|
| 1169 |
25,182,8M |
|
| 1171 |
182,25,8M |
|
| 1172 |
182,25,8M |
|
| 1204 |
182,25,8M |
|
| 3858 |
186,8,25,7M |
0 |
| 3859 |
25,186,8,7M |
0 |
| 5315 |
8,182,349,25,7M |
0 |