Query time 0.00141
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "90.21"
},
"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": 103,
"rows_produced_per_join": 103,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (3873,3862,262,1785,866,3676,3677,323,865,864,322,324,5071,6426,6428,6429,6427,5615,5613,5614,5611,5612,5692,5693))",
"cost_info": {
"read_cost": "42.06",
"eval_cost": "10.30",
"prefix_cost": "52.36",
"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.75",
"eval_cost": "0.52",
"prefix_cost": "88.41",
"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.29",
"eval_cost": "0.52",
"prefix_cost": "90.21",
"data_read_per_join": "82"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 262 |
24,7M |
0 |
| 322 |
39,7,16,24M |
0 |
| 323 |
39,16,7,24M |
0 |
| 324 |
16,39,24M |
|
| 864 |
7,16,39,24M |
0 |
| 865 |
7,16,39,24M |
0 |
| 866 |
39,16,7,24M |
0 |
| 1785 |
27,24M |
|
| 3676 |
16,24,7M |
0 |
| 3677 |
16,24,7M |
0 |
| 3862 |
39,9,24,7M |
0 |
| 3873 |
7,9,39,24M |
0 |
| 5071 |
16,24,7M |
0 |
| 5611 |
1,16,49,450,24,7M |
0 |
| 5612 |
1,16,49,450,24,7M |
0 |
| 5613 |
1,16,49,450,24,7M |
0 |
| 5614 |
1,16,49,450,24,7M |
0 |
| 5615 |
1,16,49,450,24,7M |
0 |
| 5692 |
24,49,501,16,1,7M |
0 |
| 5693 |
24,49,501,16,1,7M |
0 |
| 6426 |
558,7,24,16,1M |
0 |
| 6427 |
558,7,24,16,1M |
0 |
| 6428 |
558,7,24,16,1M |
0 |
| 6429 |
558,7,24,16,1M |
0 |