Query time 0.00134
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "44.43"
},
"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": 47,
"rows_produced_per_join": 47,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (3656,1610,1606,1608,491,1609,1676,1675,1607,1677,3582,1737,1736,1620,1520,1519,858,2692,2988,3580,3581,3587,3639,3579))",
"cost_info": {
"read_cost": "22.46",
"eval_cost": "4.70",
"prefix_cost": "27.16",
"data_read_per_join": "752"
},
"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": 2,
"filtered": "5.00",
"cost_info": {
"read_cost": "11.75",
"eval_cost": "0.24",
"prefix_cost": "43.61",
"data_read_per_join": "9K"
},
"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": 2,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.59",
"eval_cost": "0.24",
"prefix_cost": "44.43",
"data_read_per_join": "37"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 491 |
9M |
|
| 858 |
7,24,16M |
0 |
| 1519 |
24,16,7M |
0 |
| 1520 |
16,24,7M |
0 |
| 1606 |
9M |
|
| 1607 |
9M |
|
| 1608 |
9M |
|
| 1609 |
9M |
|
| 1610 |
9M |
|
| 1620 |
184M |
|
| 1675 |
9M |
|
| 1676 |
9M |
|
| 1677 |
9M |
|
| 1736 |
9M |
|
| 1737 |
9M |
|
| 2692 |
24,16,7M |
0 |
| 2988 |
16,7M |
0 |
| 3579 |
8,183,24,7M |
0 |
| 3580 |
8,183,24,7M |
0 |
| 3581 |
7,183,24,8M |
0 |
| 3582 |
187,24,7M |
0 |
| 3587 |
24,183,8,7M |
0 |
| 3639 |
8,183,24,7M |
0 |
| 3656 |
9M |
|