Query time 0.00160
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "57.51"
},
"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": 63,
"rows_produced_per_join": 63,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (3541,3540,7763,4956,5114,3338,3998,4959,5205,2645,7301,7299,7300,2646,2647,2644,1410,5154,5150,5153,2648,5152,5155,5151))",
"cost_info": {
"read_cost": "28.06",
"eval_cost": "6.30",
"prefix_cost": "34.36",
"data_read_per_join": "1008"
},
"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": "15.75",
"eval_cost": "0.32",
"prefix_cost": "56.41",
"data_read_per_join": "12K"
},
"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.79",
"eval_cost": "0.32",
"prefix_cost": "57.51",
"data_read_per_join": "50"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 1410 |
9,67,7M |
0 |
| 2644 |
7,67,9M |
0 |
| 2645 |
67,7,9M |
0 |
| 2646 |
7,67,9M |
0 |
| 2647 |
7,67,9M |
0 |
| 2648 |
7,67,9M |
0 |
| 3338 |
67M |
|
| 3540 |
67,9,7M |
0 |
| 3541 |
67,9,7M |
0 |
| 3998 |
7,67M |
0 |
| 4956 |
67,9M |
|
| 4959 |
39,67,7M |
0 |
| 5114 |
67,9,7M |
0 |
| 5150 |
67,9M |
|
| 5151 |
67,7,9M |
0 |
| 5152 |
67,7,9M |
0 |
| 5153 |
9,7,67M |
0 |
| 5154 |
9,7,67M |
0 |
| 5155 |
9,7,67M |
0 |
| 5205 |
16,67,7M |
0 |
| 7299 |
67,7,9M |
0 |
| 7300 |
67,7,9M |
0 |
| 7301 |
67,7,9M |
0 |
| 7763 |
7M |
0 |