Query time 0.00124
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "86.12"
},
"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": 98,
"rows_produced_per_join": 98,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (3586,1924,1773,3665,3666,4625,6421,7262,5971,1727,5957,6422,6423,6424,7252,7253,7250,6717,6719,6718,7251,4614,3869,1772))",
"cost_info": {
"read_cost": "40.31",
"eval_cost": "9.80",
"prefix_cost": "50.11",
"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": "24.50",
"eval_cost": "0.49",
"prefix_cost": "84.41",
"data_read_per_join": "19K"
},
"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.23",
"eval_cost": "0.49",
"prefix_cost": "86.13",
"data_read_per_join": "78"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 1727 |
276,167,7M |
0 |
| 1772 |
184,7M |
0 |
| 1773 |
24,9,7M |
0 |
| 1924 |
24,7M |
0 |
| 3586 |
39,24,7M |
0 |
| 3665 |
9,24,7M |
0 |
| 3666 |
24,9,7M |
0 |
| 3869 |
7,16,24M |
0 |
| 4614 |
16,24,7M |
0 |
| 4625 |
24,9,7M |
0 |
| 5957 |
24,167,7M |
0 |
| 5971 |
24,167,7M |
0 |
| 6421 |
558,7,24,39,1M |
0 |
| 6422 |
558,24,7,167,1M |
0 |
| 6423 |
558,24,7,167,1M |
0 |
| 6424 |
558,24,7,167,1M |
0 |
| 6717 |
24,584,7,167,1M |
0 |
| 6718 |
7,24,584,167,1M |
0 |
| 6719 |
167,24,7,584,1M |
0 |
| 7250 |
167,24,585,7M |
0 |
| 7251 |
167,24,585,7M |
0 |
| 7252 |
167,24,585,7M |
0 |
| 7253 |
167,24,585,7M |
0 |
| 7262 |
39,7,585,24M |
0 |