Query time 0.00208
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "70.59"
},
"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": 79,
"rows_produced_per_join": 79,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (1481,6430,6431,7254,7255,4050,4051,4602,4049,4034,4048,4419,4601,4422,4418,4421,4420,4423,4600,5961,5960,5958,5959,5213))",
"cost_info": {
"read_cost": "33.66",
"eval_cost": "7.90",
"prefix_cost": "41.56",
"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": 3,
"filtered": "5.00",
"cost_info": {
"read_cost": "19.75",
"eval_cost": "0.40",
"prefix_cost": "69.21",
"data_read_per_join": "15K"
},
"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.99",
"eval_cost": "0.40",
"prefix_cost": "70.59",
"data_read_per_join": "63"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 1481 |
24,16,7M |
0 |
| 4034 |
39,9,24,7M |
0 |
| 4048 |
7,9,39,24M |
0 |
| 4049 |
39,9,24,7M |
0 |
| 4050 |
7,9,39,24M |
0 |
| 4051 |
39,9,24,7M |
0 |
| 4418 |
24,9M |
|
| 4419 |
24,9M |
|
| 4420 |
24,9M |
|
| 4421 |
9,24,7M |
0 |
| 4422 |
24,9M |
|
| 4423 |
24,9M |
|
| 4600 |
24,9M |
|
| 4601 |
24,9M |
|
| 4602 |
39,9,24,7M |
0 |
| 5213 |
8,184,183,24,7M |
0 |
| 5958 |
24,9,7M |
0 |
| 5959 |
9,24,7M |
0 |
| 5960 |
9,24,7M |
0 |
| 5961 |
24,9,7M |
0 |
| 6430 |
9,24,7,558,1M |
0 |
| 6431 |
9,24,7,558,1M |
0 |
| 7254 |
9,24,585,7M |
0 |
| 7255 |
9,24,585,7M |
0 |