Query time 0.00120
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "36.88"
},
"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": 24,
"rows_produced_per_join": 24,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "2.74",
"eval_cost": "2.40",
"prefix_cost": "5.14",
"data_read_per_join": "384"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`cscart_db`.`cscart_products_categories`.`product_id` in (36470,36823,36354,69202,69204,69205,13478,36824,11185,35874,35897,36353,36825,36826,66445,69208,69209,69212,11191,11193,11195,11196,24605,35858))"
}
},
{
"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": 24,
"filtered": "100.00",
"cost_info": {
"read_cost": "20.95",
"eval_cost": "2.40",
"prefix_cost": "28.48",
"data_read_per_join": "384"
},
"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": 19,
"filtered": "81.96",
"cost_info": {
"read_cost": "6.00",
"eval_cost": "1.97",
"prefix_cost": "36.88",
"data_read_per_join": "55K"
},
"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 |
| 11185 |
2671M |
0 |
| 11191 |
2671M |
0 |
| 11193 |
2671M |
0 |
| 11195 |
2671M |
0 |
| 11196 |
2671M |
0 |
| 13478 |
2671M |
0 |
| 24605 |
2671M |
0 |
| 35858 |
2671M |
0 |
| 35874 |
2671M |
0 |
| 35897 |
2671M |
0 |
| 36353 |
2671M |
0 |
| 36354 |
2671M |
0 |
| 36470 |
2671M |
0 |
| 36823 |
2671M |
0 |
| 36824 |
2671M |
0 |
| 36825 |
2671M |
0 |
| 36826 |
2671M |
0 |
| 66445 |
2671M |
0 |
| 69202 |
2671M |
0 |
| 69204 |
2671M |
0 |
| 69205 |
2671M |
0 |
| 69208 |
2671M |
0 |
| 69209 |
2671M |
0 |
| 69212 |
2671M |
0 |