Query time 0.00263
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "76.31"
},
"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": 86,
"rows_produced_per_join": 86,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (5512,5513,5511,5514,4585,5657,5359,5360,1160,3172,2958,963,177,4689,114,5138,5143,5137,5136,5141,7554,7897,4224,6354))",
"cost_info": {
"read_cost": "36.11",
"eval_cost": "8.60",
"prefix_cost": "44.71",
"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": 4,
"filtered": "5.00",
"cost_info": {
"read_cost": "21.50",
"eval_cost": "0.43",
"prefix_cost": "74.81",
"data_read_per_join": "17K"
},
"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": 4,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.08",
"eval_cost": "0.43",
"prefix_cost": "76.32",
"data_read_per_join": "68"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 114 |
23,185,8M |
|
| 177 |
23,8M |
|
| 963 |
16,7M |
0 |
| 1160 |
8,182,36M |
|
| 2958 |
9M |
|
| 3172 |
23,185,8M |
|
| 4224 |
7,187,23M |
0 |
| 4585 |
23,8,182,7M |
0 |
| 4689 |
23,39,7M |
0 |
| 5136 |
8,182,349,23,7M |
0 |
| 5137 |
8,182,349,23,7M |
0 |
| 5138 |
8,182,349,23,7M |
0 |
| 5141 |
167,23,7M |
0 |
| 5143 |
167,23,7M |
0 |
| 5359 |
36,9,54,7M |
0 |
| 5360 |
36,8,182,54,349,7M |
0 |
| 5511 |
1,9,49,23,7M |
0 |
| 5512 |
1,9,49,23,7M |
0 |
| 5513 |
1,9,49,23,7M |
0 |
| 5514 |
1,9,49,23,7M |
0 |
| 5657 |
1,449,3,167,23,7M |
0 |
| 6354 |
23,349,49,8,1,7M |
0 |
| 7554 |
23,16M |
|
| 7897 |
187,7M |
0 |