Query time 0.00103
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "105.74"
},
"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": 122,
"rows_produced_per_join": 122,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (7192,7193,4781,7218,7217,6319,7216,6807,6808,6622,6624,6623,6621,6619,4734,4355,4747,5743,130,7153,4998,4997,5656,5655))",
"cost_info": {
"read_cost": "48.71",
"eval_cost": "12.20",
"prefix_cost": "60.91",
"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": 6,
"filtered": "5.00",
"cost_info": {
"read_cost": "30.50",
"eval_cost": "0.61",
"prefix_cost": "103.61",
"data_read_per_join": "24K"
},
"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": 6,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.53",
"eval_cost": "0.61",
"prefix_cost": "105.75",
"data_read_per_join": "97"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 130 |
182,184,8,45M |
|
| 4355 |
45,182M |
|
| 4734 |
39,167,24,7M |
0 |
| 4747 |
45,186,8,7M |
0 |
| 4781 |
39,23,7M |
0 |
| 4997 |
400,167,444,7M |
0 |
| 4998 |
400,167,444,7M |
0 |
| 5655 |
167,7M |
0 |
| 5656 |
167,7M |
0 |
| 5743 |
8,182,45M |
|
| 6319 |
7,8,349,182,572M |
0 |
| 6619 |
349,182,505,58,8,364,7M |
0 |
| 6621 |
349,182,505,58,8,364,7M |
0 |
| 6622 |
349,182,505,58,8,364,7M |
0 |
| 6623 |
349,182,505,58,8,364,7M |
0 |
| 6624 |
349,182,505,58,8,364,7M |
0 |
| 6807 |
349,505,157,182,8,7M |
0 |
| 6808 |
8,349,505,182,157,7M |
0 |
| 7153 |
182,184,8,45M |
|
| 7192 |
151,178,175,10,7M |
0 |
| 7193 |
151,178,175,10,7M |
0 |
| 7216 |
7,8,349,182,572M |
0 |
| 7217 |
7,8,349,182,572M |
0 |
| 7218 |
7,8,349,182,572M |
0 |