Query time 0.00181
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 (7704,7703,1202,2738,7304,7307,7303,7305,7306,7766,4606,2739,4122,7302,2740,2741,2742,2743,7769,7770,2744,3544,3545,3543))",
"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 |
| 1202 |
39,67,7M |
0 |
| 2738 |
39,67,7M |
0 |
| 2739 |
67,39,7M |
0 |
| 2740 |
67,39,7M |
0 |
| 2741 |
67,39,7M |
0 |
| 2742 |
67,39,7M |
0 |
| 2743 |
39,9,7M |
0 |
| 2744 |
67,39,7M |
0 |
| 3543 |
67,9,7M |
0 |
| 3544 |
67,9,7M |
0 |
| 3545 |
67,9,7M |
0 |
| 4122 |
67,9M |
|
| 4606 |
67,39,7M |
0 |
| 7302 |
67,39,7M |
0 |
| 7303 |
39,67,7M |
0 |
| 7304 |
39,67,7M |
0 |
| 7305 |
39,67,7M |
0 |
| 7306 |
39,67,7M |
0 |
| 7307 |
39,67,7M |
0 |
| 7703 |
167,7,67M |
0 |
| 7704 |
182,349,8,7,67M |
0 |
| 7766 |
7M |
0 |
| 7769 |
7M |
0 |
| 7770 |
7M |
0 |