Query time 0.01637
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "96.60"
},
"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": 107,
"rows_produced_per_join": 107,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "11.00",
"eval_cost": "10.70",
"prefix_cost": "21.70",
"data_read_per_join": "1K"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (88088,87875,87937,90323,87950,87959,90826,87952,88004,88056,88057,88058,87998,88000,88037,90329,90330,90331,90333,90334,90337,90338,90339,90340,90341,90342,90345,90346,90347,90348,87881,88031,87948,88059,88060,89985,87945,89986,88041,87940,87942,87964,90328,90332,90335,90336,90343,90344))"
}
},
{
"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": 107,
"filtered": "100.00",
"cost_info": {
"read_cost": "26.75",
"eval_cost": "10.70",
"prefix_cost": "59.15",
"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": 5,
"filtered": "5.00",
"cost_info": {
"read_cost": "26.75",
"eval_cost": "0.54",
"prefix_cost": "96.60",
"data_read_per_join": "13K"
},
"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 |
| 87875 |
7208M,7241,7309,7346 |
|
| 87881 |
7208M,7241,7309,7346 |
|
| 87937 |
7259M,7345,7347 |
|
| 87940 |
7256M,7262 |
|
| 87942 |
7260M,7320 |
|
| 87945 |
7260M,7320 |
|
| 87948 |
7259M,7345,7347 |
|
| 87950 |
7259M,7345,7347 |
|
| 87952 |
7259M,7345,7347 |
|
| 87959 |
7260M,7320 |
|
| 87964 |
7260M,7320 |
|
| 87998 |
7260M,7320 |
|
| 88000 |
7260M,7320 |
|
| 88004 |
7259M,7345,7347 |
|
| 88031 |
7260M,7320 |
|
| 88037 |
7256M,7262 |
|
| 88041 |
7261M,7349 |
|
| 88056 |
7256M,7262 |
|
| 88057 |
7256M,7262 |
|
| 88058 |
7256M,7262 |
|
| 88059 |
7256M,7262 |
|
| 88060 |
7256M,7262 |
|
| 88088 |
7256M,7262 |
|
| 89985 |
7261M,7349 |
|
| 89986 |
7261M,7349 |
|
| 90323 |
7247M,7265 |
|
| 90328 |
7247M,7265 |
|
| 90329 |
7247M,7265 |
|
| 90330 |
7247M,7265 |
|
| 90331 |
7247M,7265 |
|
| 90332 |
7247M,7265 |
|
| 90333 |
7247M,7265 |
|
| 90334 |
7247M,7265 |
|
| 90335 |
7247M,7265 |
|
| 90336 |
7247M,7265 |
|
| 90337 |
7247M,7265 |
|
| 90338 |
7247M,7265 |
|
| 90339 |
7247M,7265 |
|
| 90340 |
7247M,7265 |
|
| 90341 |
7247M,7265 |
|
| 90342 |
7247M,7265 |
|
| 90343 |
7247M,7265 |
|
| 90344 |
7247M,7265 |
|
| 90345 |
7247M,7265 |
|
| 90346 |
7247M,7265 |
|
| 90347 |
7247M,7265 |
|
| 90348 |
7247M,7265 |
|
| 90826 |
7208M,7241,7309,7346 |
|