Query time 0.00164
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "60.78"
},
"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": 67,
"rows_produced_per_join": 67,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (5885,5886,5887,7241,6743,1764,1765,1767,1763,3550,5064,1672,1667,1769,1666,1669,4063,1671,2986,7213,7211,7212,1513,1516))",
"cost_info": {
"read_cost": "29.46",
"eval_cost": "6.70",
"prefix_cost": "36.16",
"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": 3,
"filtered": "5.00",
"cost_info": {
"read_cost": "16.75",
"eval_cost": "0.34",
"prefix_cost": "59.61",
"data_read_per_join": "13K"
},
"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": 3,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.84",
"eval_cost": "0.34",
"prefix_cost": "60.78",
"data_read_per_join": "53"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 1513 |
9M |
0 |
| 1516 |
24,9,7M |
0 |
| 1666 |
24,39,9,7M |
0 |
| 1667 |
24,9,39,7M |
0 |
| 1669 |
9,24,7M |
0 |
| 1671 |
24,9,7M |
0 |
| 1672 |
24,9,7M |
0 |
| 1763 |
9M |
0 |
| 1764 |
9M |
0 |
| 1765 |
9M |
0 |
| 1767 |
9M |
0 |
| 1769 |
9,7,39,24M |
0 |
| 2986 |
24,9,39,7M |
0 |
| 3550 |
7,9,67M |
0 |
| 4063 |
7,9,39,24M |
0 |
| 5064 |
9,24,7M |
0 |
| 5885 |
9,551,7M |
0 |
| 5886 |
9,551,7M |
0 |
| 5887 |
9,551,7M |
0 |
| 6743 |
551,9,7M |
0 |
| 7211 |
7,9,24M |
0 |
| 7212 |
7,9,24M |
0 |
| 7213 |
7,9,24M |
0 |
| 7241 |
9,24,585,7M |
0 |