Query time 0.00158
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "47.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": 83,
"rows_produced_per_join": 83,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "8.59",
"eval_cost": "8.30",
"prefix_cost": "16.89",
"data_read_per_join": "1K"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (92190,92441,85652,85656,91390,85582,92488,91388,92476,92477,92478,92479,92480,92481,92482,86386,86891,90068,92002,92090,91868,89601,92227,92210,83090,84097,85554,85577,85570,89529))"
}
},
{
"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": 4,
"filtered": "5.00",
"cost_info": {
"read_cost": "20.75",
"eval_cost": "0.42",
"prefix_cost": "45.94",
"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": 4,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.04",
"eval_cost": "0.42",
"prefix_cost": "47.39",
"data_read_per_join": "66"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 83090 |
7186M |
|
| 84097 |
7186M |
|
| 85554 |
7313,7338,7219M |
|
| 85570 |
7313,7338,7219M |
|
| 85577 |
7341,7342,7343,7157M |
|
| 85582 |
7341,7342,7343,7157M |
|
| 85652 |
7184,7187M |
0 |
| 85656 |
7184,7187M |
0 |
| 86386 |
7184,7187M |
0 |
| 86891 |
7341,7342,7343,7157M |
|
| 89529 |
7184,7221M |
0 |
| 89601 |
7184,7221M |
0 |
| 90068 |
7186M |
|
| 91388 |
7337,7217M |
|
| 91390 |
7337,7217M |
|
| 91868 |
7341,7342,7343,7157M |
|
| 92002 |
7187,7184M |
0 |
| 92090 |
7187,7184M |
0 |
| 92190 |
7341,7342,7343,7157M |
|
| 92210 |
7341,7342,7343,7157M |
|
| 92227 |
7341,7342,7343,7157M |
|
| 92441 |
7341,7342,7343,7157M |
|
| 92476 |
7313,7338,7219M |
|
| 92477 |
7313,7338,7219M |
|
| 92478 |
7313,7338,7219M |
|
| 92479 |
7313,7338,7219M |
|
| 92480 |
7313,7338,7219M |
|
| 92481 |
7313,7338,7219M |
|
| 92482 |
7313,7338,7219M |
|
| 92488 |
7313,7338,7219M |
|