Query time 0.00204
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "80.40"
},
"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": 91,
"rows_produced_per_join": 91,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (6410,6809,4189,7066,7068,7065,7067,1758,6254,4677,6436,2479,5633,5910,7082,7076,7078,7081,7073,7069,7075,7074,7079,7080))",
"cost_info": {
"read_cost": "37.86",
"eval_cost": "9.10",
"prefix_cost": "46.96",
"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": "22.75",
"eval_cost": "0.46",
"prefix_cost": "78.81",
"data_read_per_join": "18K"
},
"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.14",
"eval_cost": "0.46",
"prefix_cost": "80.40",
"data_read_per_join": "72"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 1758 |
7M |
0 |
| 2479 |
16,36,7M |
0 |
| 4189 |
7,231,276,39,226M |
0 |
| 4677 |
23,54,167,36,7M |
0 |
| 5633 |
7,16,54,36M |
0 |
| 5910 |
7,167,54,36M |
0 |
| 6254 |
10,176,7M |
0 |
| 6410 |
8,7,231,349,182,226M |
0 |
| 6436 |
23,7,9,36M |
0 |
| 6809 |
7,16,226M |
0 |
| 7065 |
231,8,182,349,226M |
|
| 7066 |
231,8,182,349,226M |
|
| 7067 |
231,8,182,349,226M |
|
| 7068 |
231,8,182,349,226M |
|
| 7069 |
8,182,36M |
|
| 7073 |
8,182,36M |
|
| 7074 |
8,182,36M |
|
| 7075 |
8,182,36M |
|
| 7076 |
8,182,36M |
|
| 7078 |
8,182,36M |
|
| 7079 |
8,182,36M |
|
| 7080 |
8,182,36M |
|
| 7081 |
8,182,36M |
|
| 7082 |
8,182,36M |
|