Query time 0.00105
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "68.14"
},
"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": 76,
"rows_produced_per_join": 76,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (507,7925,3554,3552,3553,3447,4214,4554,3446,4604,7603,7604,7605,7606,4059,3865,4054,4058,4052,4056,4053,3870,3872,3871))",
"cost_info": {
"read_cost": "32.61",
"eval_cost": "7.60",
"prefix_cost": "40.21",
"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.00",
"eval_cost": "0.38",
"prefix_cost": "66.81",
"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.95",
"eval_cost": "0.38",
"prefix_cost": "68.14",
"data_read_per_join": "60"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 507 |
16,7M |
0 |
| 3446 |
39,24,7M |
0 |
| 3447 |
39,24,7M |
0 |
| 3552 |
9,24,7M |
0 |
| 3553 |
9,24,7M |
0 |
| 3554 |
9,24,7M |
0 |
| 3865 |
39,9,7,24M |
0 |
| 3870 |
7,9,39,24M |
0 |
| 3871 |
7,9,39,24M |
0 |
| 3872 |
7,9,39,24M |
0 |
| 4052 |
7,39,9,24M |
0 |
| 4053 |
7,39,9,24M |
0 |
| 4054 |
7,39,9,24M |
0 |
| 4056 |
7,39,9,24M |
0 |
| 4058 |
7,39,9,24M |
0 |
| 4059 |
7,39,9,24M |
0 |
| 4214 |
39,24,7M |
0 |
| 4554 |
39,24,7M |
0 |
| 4604 |
39,24,7M |
0 |
| 7603 |
24,9,7M |
0 |
| 7604 |
24,9,7M |
0 |
| 7605 |
24,9,7M |
0 |
| 7606 |
24,9,7M |
0 |
| 7925 |
8,24,7M |
0 |