Query time 0.00249
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "54.77"
},
"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": 96,
"rows_produced_per_join": 96,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "9.89",
"eval_cost": "9.60",
"prefix_cost": "19.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 (94375,94376,94377,94378,94379,95399,95400,95401,95434,95435,95436,95437,95438,95439,95440,95441,95704,95705,95728,95729,95730,95731,95732,95733,95734,95735,96170,96171,96172,96173,96537,96559,96560,96561,97057,97058,97994,97995,97996,97997,97998,97999,98000,98496,98497,98498,98499,98500))"
}
},
{
"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": "24.00",
"eval_cost": "0.48",
"prefix_cost": "53.09",
"data_read_per_join": "12K"
},
"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.20",
"eval_cost": "0.48",
"prefix_cost": "54.77",
"data_read_per_join": "76"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 94375 |
7331,7253M |
0 |
| 94376 |
7331,7253M |
0 |
| 94377 |
7331,7253M |
0 |
| 94378 |
7331,7253M |
0 |
| 94379 |
7331,7253M |
0 |
| 95399 |
7331,7253M |
0 |
| 95400 |
7331,7253M |
0 |
| 95401 |
7331,7253M |
0 |
| 95434 |
7331,7253M |
0 |
| 95435 |
7331,7253M |
0 |
| 95436 |
7331,7253M |
0 |
| 95437 |
7331,7253M |
0 |
| 95438 |
7331,7253M |
0 |
| 95439 |
7331,7253M |
0 |
| 95440 |
7331,7253M |
0 |
| 95441 |
7331,7253M |
0 |
| 95704 |
7331,7253M |
0 |
| 95705 |
7331,7253M |
0 |
| 95728 |
7331,7253M |
0 |
| 95729 |
7331,7253M |
0 |
| 95730 |
7331,7253M |
0 |
| 95731 |
7331,7253M |
0 |
| 95732 |
7331,7253M |
0 |
| 95733 |
7331,7253M |
0 |
| 95734 |
7331,7253M |
0 |
| 95735 |
7331,7253M |
0 |
| 96170 |
7331,7253M |
0 |
| 96171 |
7331,7253M |
0 |
| 96172 |
7331,7253M |
0 |
| 96173 |
7331,7253M |
0 |
| 96537 |
7331,7253M |
0 |
| 96559 |
7331,7253M |
0 |
| 96560 |
7331,7253M |
0 |
| 96561 |
7331,7253M |
0 |
| 97057 |
7331,7253M |
0 |
| 97058 |
7331,7253M |
0 |
| 97994 |
7331,7253M |
0 |
| 97995 |
7331,7253M |
0 |
| 97996 |
7331,7253M |
0 |
| 97997 |
7331,7253M |
0 |
| 97998 |
7331,7253M |
0 |
| 97999 |
7331,7253M |
0 |
| 98000 |
7331,7253M |
0 |
| 98496 |
7331,7253M |
0 |
| 98497 |
7331,7253M |
0 |
| 98498 |
7331,7253M |
0 |
| 98499 |
7331,7253M |
0 |
| 98500 |
7331,7253M |
0 |