Query time 0.01623
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "64.18"
},
"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": 71,
"rows_produced_per_join": 71,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "7.39",
"eval_cost": "7.10",
"prefix_cost": "14.49",
"data_read_per_join": "1K"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (91341,91378,91347,91333,91350,91337,91342,91348,91335,91340,91332,91361,91363,91391,91393,91362,91364,92240,92245,92247,92248,92249,92250,92252,92253,92485,92486,92487,91392,91394))"
}
},
{
"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": 71,
"filtered": "100.00",
"cost_info": {
"read_cost": "17.75",
"eval_cost": "7.10",
"prefix_cost": "39.34",
"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": "17.75",
"eval_cost": "0.36",
"prefix_cost": "64.19",
"data_read_per_join": "9K"
},
"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 |
| 91332 |
7336M,7337 |
0 |
| 91333 |
7337,7336M |
0 |
| 91335 |
7337,7336M |
0 |
| 91337 |
7337,7336M |
0 |
| 91340 |
7337,7336M |
0 |
| 91341 |
7337,7336M |
0 |
| 91342 |
7337,7336M |
0 |
| 91347 |
7337,7217M |
|
| 91348 |
7217M,7337 |
|
| 91350 |
7337,7217M |
|
| 91361 |
7217M,7337 |
|
| 91362 |
7217M,7337 |
|
| 91363 |
7217M,7337 |
|
| 91364 |
7217M,7337 |
|
| 91378 |
7217M,7337 |
|
| 91391 |
7217M,7337 |
|
| 91392 |
7337,7217M |
|
| 91393 |
7337,7217M |
|
| 91394 |
7217M,7337 |
|
| 92240 |
7338,7219M,7313 |
|
| 92245 |
7219M,7313,7338 |
|
| 92247 |
7219M,7338,7313 |
|
| 92248 |
7219M,7338,7313 |
|
| 92249 |
7338,7313,7219M |
|
| 92250 |
7313,7219M,7338 |
|
| 92252 |
7338,7219M,7313 |
|
| 92253 |
7338,7219M,7313 |
|
| 92485 |
7313,7219M,7338 |
|
| 92486 |
7313,7219M,7338 |
|
| 92487 |
7313,7219M,7338 |
|