Query time 0.00115
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "115.55"
},
"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": 134,
"rows_produced_per_join": 134,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (7596,7597,7598,7599,7600,6413,6412,6414,6415,6419,6420,6418,6417,6416,5607,5605,5606,5699,5703,5701,5700,5697,5702,5698))",
"cost_info": {
"read_cost": "52.91",
"eval_cost": "13.40",
"prefix_cost": "66.31",
"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": "33.50",
"eval_cost": "0.67",
"prefix_cost": "113.21",
"data_read_per_join": "26K"
},
"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.68",
"eval_cost": "0.67",
"prefix_cost": "115.56",
"data_read_per_join": "107"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 5605 |
49,450,9,1,276,24,7M |
0 |
| 5606 |
276,49,450,9,24,7M |
0 |
| 5607 |
49,450,9,1,276,24,7M |
0 |
| 5697 |
49,501,9,1,276,24,7M |
0 |
| 5698 |
49,501,9,1,276,24,7M |
0 |
| 5699 |
49,501,9,1,276,24,7M |
0 |
| 5700 |
49,501,9,1,276,24,7M |
0 |
| 5701 |
49,501,9,1,276,24,7M |
0 |
| 5702 |
49,501,9,1,276,24,7M |
0 |
| 5703 |
49,501,9,276,1,24,7M |
0 |
| 6412 |
9,7,24,558,1M |
0 |
| 6413 |
9,7,24,558,1M |
0 |
| 6414 |
9,7,24,558,1M |
0 |
| 6415 |
9,7,24,558,1M |
0 |
| 6416 |
9,7,24,558,1M |
0 |
| 6417 |
9,7,24,558,1M |
0 |
| 6418 |
9,7,24,558,1M |
0 |
| 6419 |
9,7,24,558,1M |
0 |
| 6420 |
9,7,24,558,1M |
0 |
| 7596 |
7,24,9M |
0 |
| 7597 |
9,24,7M |
0 |
| 7598 |
9,24,7M |
0 |
| 7599 |
9,24,7M |
0 |
| 7600 |
9,24,7M |
0 |