Query time 0.00103
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "75.50"
},
"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": 85,
"rows_produced_per_join": 85,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (1044,1764,1765,1767,1763,5986,7827,3550,5067,5066,5843,5842,5841,5840,5839,5838,5835,3188,3189,3749,5064,3185,1672,1667))",
"cost_info": {
"read_cost": "35.76",
"eval_cost": "8.50",
"prefix_cost": "44.26",
"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": 4,
"filtered": "5.00",
"cost_info": {
"read_cost": "21.25",
"eval_cost": "0.43",
"prefix_cost": "74.01",
"data_read_per_join": "17K"
},
"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": 4,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.06",
"eval_cost": "0.43",
"prefix_cost": "75.50",
"data_read_per_join": "68"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 1044 |
182,186,8,45M |
|
| 1667 |
24,9,39,7M |
0 |
| 1672 |
24,9,7M |
0 |
| 1763 |
9M |
|
| 1764 |
9M |
|
| 1765 |
9M |
|
| 1767 |
9M |
|
| 3185 |
24,16,7M |
0 |
| 3188 |
24,39,7M |
0 |
| 3189 |
24,39,7M |
0 |
| 3550 |
7,9,67M |
0 |
| 3749 |
39,24,7M |
0 |
| 5064 |
9,24,7M |
0 |
| 5066 |
16,24,7M |
0 |
| 5067 |
16,24,7M |
0 |
| 5835 |
8,182,24,7M |
0 |
| 5838 |
8,182,24,7M |
0 |
| 5839 |
8,182,24,7M |
0 |
| 5840 |
8,182,24,7M |
0 |
| 5841 |
8,182,24,7M |
0 |
| 5842 |
8,182,24,7M |
0 |
| 5843 |
8,182,24,7M |
0 |
| 5986 |
167,276,168,7M |
0 |
| 7827 |
167,276,168,7M |
0 |