Query time 0.00089
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 (5654,5769,5770,7755,3035,7754,102,3592,833,6582,2289,1598,1561,1580,3366,3367,6611,6615,6612,6613,6614,6616,7118,7117))",
"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 |
| 102 |
24,28M |
|
| 833 |
1,28M |
|
| 1561 |
176,10,7M |
0 |
| 1580 |
176,10,7M |
0 |
| 1598 |
176,10,7M |
0 |
| 2289 |
7,167M |
0 |
| 3035 |
8,7M |
0 |
| 3366 |
10,178,180,7M |
0 |
| 3367 |
10,178,180,7M |
0 |
| 3592 |
7M |
0 |
| 5654 |
167,7M |
0 |
| 5769 |
8,349,25,7M |
0 |
| 5770 |
8,349,25,7M |
0 |
| 6582 |
7,49,1M |
0 |
| 6611 |
7,349,182,226M |
0 |
| 6612 |
7,349,182,226M |
0 |
| 6613 |
7,349,182,226M |
0 |
| 6614 |
7,349,182,226M |
0 |
| 6615 |
7,349,182,226M |
0 |
| 6616 |
7,349,182,226M |
0 |
| 7117 |
7,349,182,226M |
0 |
| 7118 |
7,349,182,226M |
0 |
| 7754 |
8,7M |
0 |
| 7755 |
8,7M |
0 |