Query time 0.00297
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "125.64"
},
"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": 139,
"rows_produced_per_join": 139,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (1515,1514,1512,2708,4555,421,1967,423,422,4558,2723,7735,7734,6193,7737,6195,6194,7736,7750,6196,4415,4417,4414,4412,4416,7588,7589,7590,7591,7592,7240,7237,7236,7238,7239,5875,5877,5874,5879,5880,5873,5876,5878,5881,5872,3999,4004,4005))",
"cost_info": {
"read_cost": "60.66",
"eval_cost": "13.90",
"prefix_cost": "74.56",
"data_read_per_join": "2K"
},
"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": 6,
"filtered": "5.00",
"cost_info": {
"read_cost": "34.75",
"eval_cost": "0.70",
"prefix_cost": "123.21",
"data_read_per_join": "27K"
},
"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": 6,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.74",
"eval_cost": "0.70",
"prefix_cost": "125.64",
"data_read_per_join": "111"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 421 |
24,9,7M |
0 |
| 422 |
9M |
0 |
| 423 |
9M |
0 |
| 1512 |
9M |
0 |
| 1514 |
9M |
0 |
| 1515 |
9,24M |
0 |
| 1967 |
9M |
0 |
| 2708 |
9M |
0 |
| 2723 |
24,9,7M |
0 |
| 3999 |
24,9,7M |
0 |
| 4004 |
9,24,7M |
0 |
| 4005 |
24,9,7M |
0 |
| 4412 |
24,9M |
0 |
| 4414 |
24,9M |
0 |
| 4415 |
24,9M |
0 |
| 4416 |
24,9M |
0 |
| 4417 |
24,9M |
0 |
| 4555 |
24,9,7M |
0 |
| 4558 |
9M |
0 |
| 5872 |
9,24,7M |
0 |
| 5873 |
9,24,7M |
0 |
| 5874 |
9,24,7M |
0 |
| 5875 |
9,24,7M |
0 |
| 5876 |
9,24,7M |
0 |
| 5877 |
9,24,7M |
0 |
| 5878 |
9,24,7M |
0 |
| 5879 |
9,24,7M |
0 |
| 5880 |
9,24,7M |
0 |
| 5881 |
9,24,7M |
0 |
| 6193 |
9,24,7M |
0 |
| 6194 |
24,9,7M |
0 |
| 6195 |
24,9,7M |
0 |
| 6196 |
24,9,7M |
0 |
| 7236 |
9,24,585,7M |
0 |
| 7237 |
9,24,585,7M |
0 |
| 7238 |
9,24,585,7M |
0 |
| 7239 |
9,24,585,7M |
0 |
| 7240 |
9,24,585,7M |
0 |
| 7588 |
9,24,7M |
0 |
| 7589 |
9,24,7M |
0 |
| 7590 |
9,24,7M |
0 |
| 7591 |
9,24,7M |
0 |
| 7592 |
9,24,7M |
0 |
| 7734 |
24,9,7M |
0 |
| 7735 |
24,9,7M |
0 |
| 7736 |
24,9,7M |
0 |
| 7737 |
24,9,7M |
0 |
| 7750 |
24,9,7M |
0 |