Query time 0.00092
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "23.70"
},
"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": 16,
"rows_produced_per_join": 16,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "1.90",
"eval_cost": "1.60",
"prefix_cost": "3.50",
"data_read_per_join": "256"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`cscart_db`.`cscart_products_categories`.`product_id` in (67736,67767,67744,68003,68011,67751,68006,68010,68036,68043,68004,68005,68007,68049,68059,68084))"
}
},
{
"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": 16,
"filtered": "100.00",
"cost_info": {
"read_cost": "13.00",
"eval_cost": "1.60",
"prefix_cost": "18.10",
"data_read_per_join": "256"
},
"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": 13,
"filtered": "81.96",
"cost_info": {
"read_cost": "4.00",
"eval_cost": "1.31",
"prefix_cost": "23.70",
"data_read_per_join": "36K"
},
"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 |
| 67736 |
2927M |
0 |
| 67744 |
2927M |
0 |
| 67751 |
2927M |
0 |
| 67767 |
2927M |
0 |
| 68003 |
2927M |
0 |
| 68004 |
2927M |
0 |
| 68005 |
2927M |
0 |
| 68006 |
2927M |
0 |
| 68007 |
2927M |
0 |
| 68010 |
2927M |
0 |
| 68011 |
2927M |
0 |
| 68036 |
2927M |
0 |
| 68043 |
2927M |
0 |
| 68049 |
2927M |
0 |
| 68059 |
2927M |
0 |
| 68084 |
2927M |
0 |