Query time 0.00145
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "45.12"
},
"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": 79,
"rows_produced_per_join": 79,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "8.19",
"eval_cost": "7.90",
"prefix_cost": "16.09",
"data_read_per_join": "1K"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (87201,87218,90801,85014,85020,85026,85032,87182,87199,87216,90799,87154,87155,87156,87157,87158,87159,87287,87180,87197,87214,85018,85024,85030))"
}
},
{
"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": 3,
"filtered": "5.00",
"cost_info": {
"read_cost": "19.75",
"eval_cost": "0.40",
"prefix_cost": "43.74",
"data_read_per_join": "10K"
},
"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": 3,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.99",
"eval_cost": "0.40",
"prefix_cost": "45.12",
"data_read_per_join": "63"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 85014 |
7210,7211,7212M |
0 |
| 85018 |
7210,7211,7214M |
0 |
| 85020 |
7210,7211,7212M |
0 |
| 85024 |
7210,7211,7214M |
0 |
| 85026 |
7210,7211,7212M |
0 |
| 85030 |
7210,7211,7214M |
0 |
| 85032 |
7210,7211,7212M |
0 |
| 87154 |
7241,7309,7346,7208M |
|
| 87155 |
7241,7309,7346,7208M |
|
| 87156 |
7241,7309,7346,7208M |
|
| 87157 |
7241,7309,7346,7208M |
|
| 87158 |
7241,7309,7346,7208M |
|
| 87159 |
7241,7309,7346,7208M |
|
| 87180 |
7210,7211,7212M |
0 |
| 87182 |
7210,7211,7212M |
0 |
| 87197 |
7210,7211,7212M |
0 |
| 87199 |
7210,7211,7212M |
0 |
| 87201 |
7210,7211,7212M |
0 |
| 87214 |
7210,7211,7212M |
0 |
| 87216 |
7210,7211,7212M |
0 |
| 87218 |
7210,7211,7212M |
0 |
| 87287 |
7241,7309,7346,7208M |
|
| 90799 |
7210,7211,7212M |
0 |
| 90801 |
7210,7211,7212M |
0 |