Query time 0.00195
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "74.68"
},
"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": 84,
"rows_produced_per_join": 84,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (3052,3634,3053,5209,3852,3851,5235,5234,5849,5554,5551,5553,5550,5552,5123,5125,2242,4244,7892,6059,5895,5844,6034,6035))",
"cost_info": {
"read_cost": "35.41",
"eval_cost": "8.40",
"prefix_cost": "43.81",
"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.00",
"eval_cost": "0.42",
"prefix_cost": "73.21",
"data_read_per_join": "16K"
},
"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.05",
"eval_cost": "0.42",
"prefix_cost": "74.68",
"data_read_per_join": "67"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 2242 |
24,7M |
0 |
| 3052 |
9,23,7M |
0 |
| 3053 |
9,23,7M |
0 |
| 3634 |
9,23,7M |
0 |
| 3851 |
8,349,182,7M |
0 |
| 3852 |
8,349,182,7M |
0 |
| 4244 |
23,7M |
0 |
| 5123 |
10,176,177,178,175,7M |
0 |
| 5125 |
10,176,177,178,175,7M |
0 |
| 5209 |
7,298,16,57M |
0 |
| 5234 |
298,349,57M |
|
| 5235 |
298,349,57M |
|
| 5550 |
10,176,7M |
0 |
| 5551 |
10,176,7M |
0 |
| 5552 |
10,176,7M |
0 |
| 5553 |
10,176,7M |
0 |
| 5554 |
10,176,7M |
0 |
| 5844 |
9,551,7M |
0 |
| 5849 |
67,39,7M |
0 |
| 5895 |
39,551,7M |
0 |
| 6034 |
9,551,1,7M |
0 |
| 6035 |
9,551,1,7M |
0 |
| 6059 |
39,551,7M |
0 |
| 7892 |
167,337,7M |
0 |