Query time 0.00057
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "20.13"
},
"grouping_operation": {
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"link_type",
"pt"
],
"key": "pt",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"rows_examined_per_scan": 35,
"rows_produced_per_join": 35,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "3.77",
"eval_cost": "3.50",
"prefix_cost": "7.27",
"data_read_per_join": "560"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (85751,85761,87390,82815,82888,82961,83335,83345,90006,83048,90884,90963,84540,84606,84513,84579,84670,89456,84874,87459,82805,82806,82878,82879))"
}
},
{
"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": [
"nuie_scalesta_net.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "5.00",
"cost_info": {
"read_cost": "8.75",
"eval_cost": "0.18",
"prefix_cost": "19.52",
"data_read_per_join": "4K"
},
"used_columns": [
"category_id",
"usergroup_ids",
"status",
"storefront_id"
],
"attached_condition": "((`nuie_scalesta_net`.`cscart_categories`.`storefront_id` in (0,1)) and ((`nuie_scalesta_net`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`nuie_scalesta_net`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`nuie_scalesta_net`.`cscart_categories`.`usergroup_ids`))) and (`nuie_scalesta_net`.`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",
"nuie_scalesta_net.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.44",
"eval_cost": "0.18",
"prefix_cost": "20.13",
"data_read_per_join": "28"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 82805 |
7170,7171M |
0 |
| 82806 |
7170,7171M |
0 |
| 82815 |
7192M |
|
| 82878 |
7170,7171M |
0 |
| 82879 |
7170,7171M |
0 |
| 82888 |
7192M |
|
| 82961 |
7192M |
|
| 83048 |
7192M |
|
| 83335 |
7192M |
|
| 83345 |
7192M |
|
| 84513 |
7223M |
|
| 84540 |
7223M |
|
| 84579 |
7223M |
|
| 84606 |
7223M |
|
| 84670 |
7223M |
|
| 84874 |
7170,7171M |
0 |
| 85751 |
7170,7213M |
0 |
| 85761 |
7170,7213M |
0 |
| 87390 |
7170,7223M |
0 |
| 87459 |
7170,7213M |
0 |
| 89456 |
7170,7213M |
0 |
| 90006 |
7170,7191M |
0 |
| 90884 |
7192M |
|
| 90963 |
7192M |
|