Query time 0.00183
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "46.07"
},
"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": 49,
"rows_produced_per_join": 49,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (4004,4005,4003,4002,4006,4001,4000,4598,2510,2507,2508,2511,2509,3753,489,493,494,488,492,416,497,495,3182,3181))",
"cost_info": {
"read_cost": "23.16",
"eval_cost": "4.90",
"prefix_cost": "28.06",
"data_read_per_join": "784"
},
"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": 2,
"filtered": "5.00",
"cost_info": {
"read_cost": "12.25",
"eval_cost": "0.25",
"prefix_cost": "45.21",
"data_read_per_join": "9K"
},
"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": 2,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.61",
"eval_cost": "0.25",
"prefix_cost": "46.07",
"data_read_per_join": "39"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 416 |
9M |
|
| 488 |
9M |
|
| 489 |
9M |
|
| 492 |
9M |
|
| 493 |
24M |
|
| 494 |
9M |
|
| 495 |
9M |
|
| 497 |
9M |
|
| 2507 |
24,9,7M |
0 |
| 2508 |
24,9,7M |
0 |
| 2509 |
24,9,7M |
0 |
| 2510 |
24,9,7M |
0 |
| 2511 |
24,9,7M |
0 |
| 3181 |
9M |
|
| 3182 |
24,9,7M |
0 |
| 3753 |
9M |
|
| 4000 |
9,24,7M |
0 |
| 4001 |
24,9,7M |
0 |
| 4002 |
9,24,7M |
0 |
| 4003 |
24,9,7M |
0 |
| 4004 |
9,24,7M |
0 |
| 4005 |
24,9,7M |
0 |
| 4006 |
9,24,7M |
0 |
| 4598 |
9,24,7M |
0 |