Query time 0.00177
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "64.05"
},
"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": 71,
"rows_produced_per_join": 71,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (7844,7731,7482,7483,7481,7753,7752,7494,7495,7493,7478,7477,7476,5202,5200,5203,5201,5199,2748,6978,6977,6975,6976,7087))",
"cost_info": {
"read_cost": "30.86",
"eval_cost": "7.10",
"prefix_cost": "37.96",
"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": 3,
"filtered": "5.00",
"cost_info": {
"read_cost": "17.75",
"eval_cost": "0.36",
"prefix_cost": "62.81",
"data_read_per_join": "14K"
},
"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": 3,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.89",
"eval_cost": "0.36",
"prefix_cost": "64.05",
"data_read_per_join": "56"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 2748 |
176,10,7M |
0 |
| 5199 |
28,67,7M |
0 |
| 5200 |
28,7M |
0 |
| 5201 |
28,67,7M |
0 |
| 5202 |
28,7,67M |
0 |
| 5203 |
28,7,67M |
0 |
| 6975 |
634,16M |
|
| 6976 |
634,16M |
|
| 6977 |
634,16M |
|
| 6978 |
634,16M |
|
| 7087 |
634,39M |
|
| 7476 |
67,16,7M |
0 |
| 7477 |
67,16,7M |
0 |
| 7478 |
67,16,7M |
0 |
| 7481 |
67,16,7M |
0 |
| 7482 |
67,16,7M |
0 |
| 7483 |
67,16,7M |
0 |
| 7493 |
67,16,7M |
0 |
| 7494 |
67,16,7M |
0 |
| 7495 |
67,16,7M |
0 |
| 7731 |
67,16,7M |
0 |
| 7752 |
67,16,7M |
0 |
| 7753 |
67,16,7M |
0 |
| 7844 |
67,16,7M |
0 |