Query time 0.02122
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "71.39"
},
"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 (91359,91389,92508,86828,91331,91360,91357,91387,92241,92242,92243,92244,92246,92251,92483,92484,91358,91390,92488,91388,92476,92477,92478,92479,92480,92481,92482,85554,85570,85543))"
}
},
{
"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": 79,
"filtered": "100.00",
"cost_info": {
"read_cost": "19.75",
"eval_cost": "7.90",
"prefix_cost": "43.74",
"data_read_per_join": "1K"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
},
{
"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": "71.39",
"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')))"
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 85543 |
7219M,7313,7338 |
|
| 85554 |
7219M,7338,7313 |
|
| 85570 |
7219M,7338,7313 |
|
| 86828 |
7337,7336M |
0 |
| 91331 |
7337,7336M |
0 |
| 91357 |
7337,7217M |
|
| 91358 |
7217M,7337 |
|
| 91359 |
7337,7217M |
|
| 91360 |
7217M,7337 |
|
| 91387 |
7337,7217M |
|
| 91388 |
7337,7217M |
|
| 91389 |
7337,7217M |
|
| 91390 |
7337,7217M |
|
| 92241 |
7313,7219M,7338 |
|
| 92242 |
7313,7219M,7338 |
|
| 92243 |
7313,7219M,7338 |
|
| 92244 |
7219M,7313,7338 |
|
| 92246 |
7219M,7338,7313 |
|
| 92251 |
7313,7338,7219M |
|
| 92476 |
7219M,7313,7338 |
|
| 92477 |
7313,7338,7219M |
|
| 92478 |
7313,7338,7219M |
|
| 92479 |
7313,7338,7219M |
|
| 92480 |
7313,7338,7219M |
|
| 92481 |
7338,7313,7219M |
|
| 92482 |
7338,7313,7219M |
|
| 92483 |
7219M,7338,7313 |
|
| 92484 |
7219M,7338,7313 |
|
| 92488 |
7313,7338,7219M |
|
| 92508 |
7336M,7339 |
0 |