Query time 0.00248
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "159.30"
},
"grouping_operation": {
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"link_type",
"pt",
"idx_product_category_lookup",
"idx_products_categories_composite"
],
"key": "idx_products_categories_composite",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"rows_examined_per_scan": 116,
"rows_produced_per_join": 116,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "12.13",
"eval_cost": "11.60",
"prefix_cost": "23.73",
"data_read_per_join": "1K"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`cscart_db`.`cscart_products_categories`.`product_id` in (70149,69350,69997,65553,65832,65096,67762,68110,67730,68008,68009,68052,68065,65122,68039,68071,68085,68086,68101,64976,67769,68057,68058,69972,19741,19744,19748,27363,27368,27370,68038,68089,68099,69999,19742,19743,19745,19746,19747,19749,19750,19751,19752,19753,19754,19755,27337,27339,27340,27342,27343,27345,27359,27360,27361,27364,27365,27366,27367,27369,27371,65124,68068,68129,70000,70001,70002,70003,70145,70292,70293,70294,70297,70298))"
}
},
{
"table": {
"table_name": "product_position_source",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"pt",
"idx_product_category_lookup",
"idx_products_categories_composite"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id",
"product_id"
],
"key_length": "6",
"ref": [
"const",
"cscart_db.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 116,
"filtered": "100.00",
"cost_info": {
"read_cost": "83.38",
"eval_cost": "11.60",
"prefix_cost": "118.70",
"data_read_per_join": "1K"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
},
{
"table": {
"table_name": "cscart_categories",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"p_category_id",
"idx_categories_storefront_status",
"idx_categories_usergroup_status",
"idx_categories_status_id_path"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"cscart_db.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 95,
"filtered": "81.96",
"cost_info": {
"read_cost": "29.00",
"eval_cost": "9.51",
"prefix_cost": "159.30",
"data_read_per_join": "265K"
},
"used_columns": [
"category_id",
"status",
"storefront_id"
],
"attached_condition": "((`cscart_db`.`cscart_categories`.`storefront_id` in (0,1)) and (`cscart_db`.`cscart_categories`.`status` in ('A','H')))"
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 19741 |
438,2720M,3089 |
|
| 19742 |
438,2720M,3089 |
|
| 19743 |
438,2720M,3089 |
|
| 19744 |
438,2720M,3089 |
|
| 19745 |
438,2720M,3089 |
|
| 19746 |
438,2720M,3089 |
|
| 19747 |
438,2720M,3089 |
|
| 19748 |
438,2720M,3089 |
|
| 19749 |
438,2720M,3089 |
|
| 19750 |
438,2720M,3089 |
|
| 19751 |
438,2720M,3089 |
|
| 19752 |
438,2720M,3089 |
|
| 19753 |
438,2720M,3089 |
|
| 19754 |
438,2720M,3089 |
|
| 19755 |
438,2720M,3089 |
|
| 27337 |
3089M |
|
| 27339 |
3089M |
|
| 27340 |
3089 |
|
| 27342 |
3089M |
|
| 27343 |
3089M |
|
| 27345 |
3089M |
|
| 27359 |
3089M |
|
| 27360 |
3089M |
|
| 27361 |
3089M |
|
| 27363 |
2850M,3089 |
|
| 27364 |
2850M,3089 |
|
| 27365 |
2850M,3089 |
|
| 27366 |
2850M,3089 |
|
| 27367 |
2850M,3089 |
|
| 27368 |
2850M,3089 |
|
| 27369 |
2850M,3089 |
|
| 27370 |
2850M,3089 |
|
| 27371 |
2850M,3089 |
|
| 64976 |
2712M |
0 |
| 65096 |
2714M |
|
| 65122 |
2714M |
|
| 65124 |
2714M |
|
| 65553 |
2301,2924M |
|
| 65832 |
2716M |
|
| 67730 |
2715M |
|
| 67762 |
2713M |
|
| 67769 |
2924M |
|
| 68008 |
2924M |
|
| 68009 |
2713M |
|
| 68038 |
2715M |
|
| 68039 |
2924M |
|
| 68052 |
2714M |
|
| 68057 |
2924M |
|
| 68058 |
2924M |
|
| 68065 |
2924M |
|
| 68068 |
2715M |
|
| 68071 |
2924M |
|
| 68085 |
2714M |
|
| 68086 |
2924M |
|
| 68089 |
2716M |
|
| 68099 |
2924M |
|
| 68101 |
2714M |
|
| 68110 |
2713M |
|
| 68129 |
2715M |
|
| 69350 |
2714M |
|
| 69972 |
3089M,3180 |
|
| 69997 |
2716M |
|
| 69999 |
2716M |
|
| 70000 |
2716M |
|
| 70001 |
2716M |
|
| 70002 |
2716M |
|
| 70003 |
2716M |
|
| 70145 |
2714M |
|
| 70149 |
2924M |
|
| 70292 |
2714M |
|
| 70293 |
2714M |
|
| 70294 |
2714M |
|
| 70297 |
2714M |
|
| 70298 |
2714M |
|