Query time 0.00217
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "107.38"
},
"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": 124,
"rows_produced_per_join": 124,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (7037,7040,6355,6051,6045,4315,6042,4316,6043,6036,4347,6369,4344,4345,5303,6050,7351,5304,4348,4346,6349,6345,6361,7706))",
"cost_info": {
"read_cost": "49.41",
"eval_cost": "12.40",
"prefix_cost": "61.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": [
"dbggbern.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 6,
"filtered": "5.00",
"cost_info": {
"read_cost": "31.00",
"eval_cost": "0.62",
"prefix_cost": "105.21",
"data_read_per_join": "24K"
},
"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": 6,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.55",
"eval_cost": "0.62",
"prefix_cost": "107.38",
"data_read_per_join": "99"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 4315 |
67,444,7,400M |
0 |
| 4316 |
444,7,67,400M |
0 |
| 4344 |
67,444,7,9,400M |
0 |
| 4345 |
67,444,7,9,400M |
0 |
| 4346 |
67,444,7,9,400M |
0 |
| 4347 |
67,444,7,9,400M |
0 |
| 4348 |
67,444,7,9,400M |
0 |
| 5303 |
7,444,9,447,67,400M |
0 |
| 5304 |
7,444,9,447,67,400M |
0 |
| 6036 |
400,444,9,7M |
0 |
| 6042 |
400,167,7,444M |
0 |
| 6043 |
400,7,444,167,67M |
0 |
| 6045 |
444,400,67,167,7M |
0 |
| 6050 |
400,444,9,7M |
0 |
| 6051 |
444,400,67,167,7M |
0 |
| 6345 |
9,400,7M |
0 |
| 6349 |
400,9,444,7M |
0 |
| 6355 |
16,7,67,444,400M |
0 |
| 6361 |
400,7,16,67M |
0 |
| 6369 |
400,9,7,444,67M |
0 |
| 7037 |
182,349,8,7,400,629,67M |
0 |
| 7040 |
182,349,8,7,400,629,67M |
0 |
| 7351 |
400,9,7M |
0 |
| 7706 |
349,182,7,8,67M |
0 |