Query time 0.00195
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "85.31"
},
"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": 97,
"rows_produced_per_join": 97,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (7249,7247,7243,7248,7246,7244,7242,7245,6692,6702,6703,6704,6705,6707,6708,6706,5704,1297,1301,1298,1299,1296,1294,1300))",
"cost_info": {
"read_cost": "39.96",
"eval_cost": "9.70",
"prefix_cost": "49.66",
"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": 4,
"filtered": "5.00",
"cost_info": {
"read_cost": "24.25",
"eval_cost": "0.49",
"prefix_cost": "83.61",
"data_read_per_join": "19K"
},
"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": 4,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.21",
"eval_cost": "0.49",
"prefix_cost": "85.31",
"data_read_per_join": "77"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 1294 |
24,9,7M |
0 |
| 1296 |
9M |
|
| 1297 |
24,9,7M |
0 |
| 1298 |
24,9,7M |
0 |
| 1299 |
24,9,7M |
0 |
| 1300 |
24,9,7M |
0 |
| 1301 |
9,24,7M |
0 |
| 5704 |
49,501,9,1,276,24,7M |
0 |
| 6692 |
9,7,584,1M |
0 |
| 6702 |
584,7,9,1M |
0 |
| 6703 |
7,9,584,1M |
0 |
| 6704 |
7,9,584,1M |
0 |
| 6705 |
7,9,584,1M |
0 |
| 6706 |
584,9,7,1M |
0 |
| 6707 |
584,7,9,1M |
0 |
| 6708 |
584,9,7,1M |
0 |
| 7242 |
7,585,9,24M |
0 |
| 7243 |
7,585,9,24M |
0 |
| 7244 |
7,585,9,24M |
0 |
| 7245 |
7,585,9,24M |
0 |
| 7246 |
7,585,9,24M |
0 |
| 7247 |
7,585,9,24M |
0 |
| 7248 |
7,585,9,24M |
0 |
| 7249 |
7,585,9,24M |
0 |