Query time 0.00115
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "88.58"
},
"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": 101,
"rows_produced_per_join": 101,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (6028,6030,7651,7645,7647,7648,7649,7646,6026,6027,6858,6857,6855,6860,6859,6856,6854,6852,6853,6850,6851,5503,6760,6762))",
"cost_info": {
"read_cost": "41.36",
"eval_cost": "10.10",
"prefix_cost": "51.46",
"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": 5,
"filtered": "5.00",
"cost_info": {
"read_cost": "25.25",
"eval_cost": "0.51",
"prefix_cost": "86.81",
"data_read_per_join": "20K"
},
"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": 5,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.26",
"eval_cost": "0.51",
"prefix_cost": "88.58",
"data_read_per_join": "80"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 5503 |
7,167,1,23M |
0 |
| 6026 |
22,167,23,7M |
0 |
| 6027 |
22,167,23,7M |
0 |
| 6028 |
22,167,23,7M |
0 |
| 6030 |
22,167,23,7M |
0 |
| 6760 |
36,54,182,349,8,7M |
0 |
| 6762 |
16,23,36,54,7M |
0 |
| 6850 |
23,167,7M |
0 |
| 6851 |
167,23,7M |
0 |
| 6852 |
7M |
0 |
| 6853 |
7M |
0 |
| 6854 |
23,39,7M |
0 |
| 6855 |
349,23,182,8,7M |
0 |
| 6856 |
9,23,7M |
0 |
| 6857 |
8,349,182,23,7M |
0 |
| 6858 |
8,182,23,349,7M |
0 |
| 6859 |
23,9,7M |
0 |
| 6860 |
23,9,7M |
0 |
| 7645 |
167,23,7M |
0 |
| 7646 |
167,23,7M |
0 |
| 7647 |
167,23,7M |
0 |
| 7648 |
167,23,7M |
0 |
| 7649 |
167,23,7M |
0 |
| 7651 |
167,23,7M |
0 |