Query time 0.00322
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "155.07"
},
"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": 175,
"rows_produced_per_join": 175,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (4341,4342,6036,4347,6369,4344,4345,5303,6050,7351,5304,4348,4346,6349,6345,4122,2743,3544,3545,3543,3541,3540,4956,5114,2645,7301,7299,7300,2646,2647,2644,1410,5154,5150,5153,2648,5152,5155,5151,2886,6436,2773,6440,7223,7116,7221,7222,7224))",
"cost_info": {
"read_cost": "73.26",
"eval_cost": "17.50",
"prefix_cost": "90.76",
"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": 8,
"filtered": "5.00",
"cost_info": {
"read_cost": "43.75",
"eval_cost": "0.88",
"prefix_cost": "152.01",
"data_read_per_join": "35K"
},
"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": 8,
"filtered": "100.00",
"cost_info": {
"read_cost": "2.19",
"eval_cost": "0.88",
"prefix_cost": "155.07",
"data_read_per_join": "140"
},
"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 |
| 2743 |
39,9,7M |
0 |
| 2773 |
9,36,7M |
0 |
| 2886 |
167,9,226M |
0 |
| 3540 |
67,9,7M |
0 |
| 3541 |
67,9,7M |
0 |
| 3543 |
67,9,7M |
0 |
| 3544 |
67,9,7M |
0 |
| 3545 |
67,9,7M |
0 |
| 4122 |
67,9M |
0 |
| 4341 |
67,444,7,9,400M |
0 |
| 4342 |
67,444,7,9,400M |
0 |
| 4344 |
67,444,7,9,400M |
0 |
| 4345 |
67,444,7,9,400M |
0 |
| 4346 |
67,444,7,9,400M |
0 |
| 4347 |
67,444,7,9,400M |
0 |
| 4348 |
67,444,7,9,400M |
0 |
| 4956 |
67,9M |
0 |
| 5114 |
67,9,7M |
0 |
| 5150 |
67,9M |
0 |
| 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 |
| 5303 |
7,444,9,447,67,400M |
0 |
| 5304 |
7,444,9,447,67,400M |
0 |
| 6036 |
400,444,9,7M |
0 |
| 6050 |
400,444,9,7M |
0 |
| 6345 |
9,400,7M |
0 |
| 6349 |
400,9,444,7M |
0 |
| 6369 |
400,9,7,444,67M |
0 |
| 6436 |
23,7,9,36M |
0 |
| 6440 |
23,7,9,36M |
0 |
| 7116 |
23,7,9,36M |
0 |
| 7221 |
7,23,9,36M |
0 |
| 7222 |
7,23,9,36M |
0 |
| 7223 |
7,23,9,36M |
0 |
| 7224 |
7,23,9,36M |
0 |
| 7299 |
67,7,9M |
0 |
| 7300 |
67,7,9M |
0 |
| 7301 |
67,7,9M |
0 |
| 7351 |
400,9,7M |
0 |