Query time 0.00308
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "329.75"
},
"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": 374,
"rows_produced_per_join": 374,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (4418,4421,4420,4423,4600,5961,5960,5958,5959,1773,3665,3666,4625,5065,3654,2237,3435,1486,1083,1231,1485,2238,3427,3437,3502,3501,3436,7751,6072,5603,6710,4839,4838,7593,7594,7595,7596,7597,7598,7599,7600,6413,6412,6414,6415,6419,6420,6418,6417,6416,5607,5605,5606,5699,5703,5701,5700,5697,5702,5698,7249,7247,7243,7248,7246,7244,7242,7245,6692,6702,6703,6704,6705,6707,6708,6706,5704,1297,1301,1298,1299,1296,1294,1300,1295,3576,3585,3584,3575,7601,7602,6709,3146,3752,3145,5096))",
"cost_info": {
"read_cost": "154.91",
"eval_cost": "37.40",
"prefix_cost": "192.31",
"data_read_per_join": "5K"
},
"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": 18,
"filtered": "5.00",
"cost_info": {
"read_cost": "93.50",
"eval_cost": "1.87",
"prefix_cost": "323.21",
"data_read_per_join": "74K"
},
"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": 18,
"filtered": "100.00",
"cost_info": {
"read_cost": "4.68",
"eval_cost": "1.87",
"prefix_cost": "329.76",
"data_read_per_join": "299"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 1083 |
9,24,7M |
0 |
| 1231 |
9,7M |
0 |
| 1294 |
24,9,7M |
0 |
| 1295 |
9M |
0 |
| 1296 |
9M |
0 |
| 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 |
| 1485 |
9,24,7M |
0 |
| 1486 |
9,24,7M |
0 |
| 1773 |
24,9,7M |
0 |
| 2237 |
9,24,7M |
0 |
| 2238 |
9,24,7M |
0 |
| 3145 |
9,24,7M |
0 |
| 3146 |
9,24,7M |
0 |
| 3427 |
9,24,7M |
0 |
| 3435 |
9,24,7M |
0 |
| 3436 |
9,24,7M |
0 |
| 3437 |
9,24,7M |
0 |
| 3501 |
9,24,7M |
0 |
| 3502 |
9,24,7M |
0 |
| 3575 |
9,24,7M |
0 |
| 3576 |
9,24,7M |
0 |
| 3584 |
7,9,24M |
0 |
| 3585 |
9,24,7M |
0 |
| 3654 |
9,24,7M |
0 |
| 3665 |
9,24,7M |
0 |
| 3666 |
24,9,7M |
0 |
| 3752 |
9,24,7M |
0 |
| 4418 |
24,9M |
0 |
| 4420 |
24,9M |
0 |
| 4421 |
9,24,7M |
0 |
| 4423 |
24,9M |
0 |
| 4600 |
24,9M |
0 |
| 4625 |
24,9,7M |
0 |
| 4838 |
24,9,276,7M |
0 |
| 4839 |
9,276,24,7M |
0 |
| 5065 |
9,24,7M |
0 |
| 5096 |
9,24,7M |
0 |
| 5603 |
49,450,9,276,1,24,7M |
0 |
| 5605 |
49,450,9,1,276,24,7M |
0 |
| 5606 |
276,49,450,9,24,7M |
0 |
| 5607 |
49,450,9,1,276,24,7M |
0 |
| 5697 |
49,501,9,1,276,24,7M |
0 |
| 5698 |
49,501,9,1,276,24,7M |
0 |
| 5699 |
49,501,9,1,276,24,7M |
0 |
| 5700 |
49,501,9,1,276,24,7M |
0 |
| 5701 |
49,501,9,1,276,24,7M |
0 |
| 5702 |
49,501,9,1,276,24,7M |
0 |
| 5703 |
49,501,9,276,1,24,7M |
0 |
| 5704 |
49,501,9,1,276,24,7M |
0 |
| 5958 |
24,9,7M |
0 |
| 5959 |
9,24,7M |
0 |
| 5960 |
9,24,7M |
0 |
| 5961 |
24,9,7M |
0 |
| 6072 |
9,24,7M |
0 |
| 6412 |
9,7,24,558,1M |
0 |
| 6413 |
9,7,24,558,1M |
0 |
| 6414 |
9,7,24,558,1M |
0 |
| 6415 |
9,7,24,558,1M |
0 |
| 6416 |
9,7,24,558,1M |
0 |
| 6417 |
9,7,24,558,1M |
0 |
| 6418 |
9,7,24,558,1M |
0 |
| 6419 |
9,7,24,558,1M |
0 |
| 6420 |
9,7,24,558,1M |
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 |
| 6709 |
9,7,24,584,1M |
0 |
| 6710 |
584,9,24,1,7M |
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 |
| 7593 |
7,24,9M |
0 |
| 7594 |
7,24,9M |
0 |
| 7595 |
7,24,9M |
0 |
| 7596 |
7,24,9M |
0 |
| 7597 |
9,24,7M |
0 |
| 7598 |
9,24,7M |
0 |
| 7599 |
9,24,7M |
0 |
| 7600 |
9,24,7M |
0 |
| 7601 |
7,24,9M |
0 |
| 7602 |
7,24,9M |
0 |
| 7751 |
9,24,7M |
0 |