Query time 0.04443
JSON explain
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "pfv",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"fl",
"variant_id",
"lang_code",
"product_id",
"fpl",
"idx_product_feature_variant_id"
],
"key": "PRIMARY",
"key_length": "6",
"used_key_parts": ["feature_id", "product_id"],
"rows": 269,
"filtered": 0.01697493,
"attached_condition": "pfv.feature_id in (20287,23708,20281,20427,21211,21748,23771,23772,19958,19944,22921,20054,23304,20288,22420,20052) and pfv.product_id in (4373,36464,4379,3995,21746,23481,16847,5726,16416,28162,5405,32286,4372,285,5414) and pfv.lang_code = 'vi'",
"using_index": true
}
},
{
"table": {
"table_name": "fv",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "feature_id"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["variant_id"],
"ref": ["dev_db.pfv.variant_id"],
"rows": 1,
"filtered": 100,
"attached_condition": "fv.feature_id = pfv.feature_id"
}
},
{
"table": {
"table_name": "fvd",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "9",
"used_key_parts": ["variant_id", "lang_code"],
"ref": ["dev_db.pfv.variant_id", "const"],
"rows": 1,
"filtered": 100,
"index_condition": "fvd.lang_code = 'vi'"
}
}
]
}
}
Result
feature_id |
product_id |
variant_id |
position |
variant |
19944 |
16416 |
69685 |
0 |
Đen |
19958 |
5726 |
69750 |
0 |
Nâu rêu |
20052 |
5414 |
70123 |
0 |
Màu nhạt |
20054 |
5405 |
70127 |
0 |
Màu nhạt |
20281 |
4379 |
70957 |
0 |
Xanh đen |
20287 |
4373 |
70975 |
0 |
Đỏ |
20288 |
4372 |
70978 |
0 |
Đỏ |
20427 |
3995 |
71484 |
0 |
Bánh kem |
21211 |
21746 |
74203 |
0 |
Hồng dịu dàng |
21748 |
23481 |
76046 |
0 |
Màu xanh cổ vịt |
22420 |
285 |
78654 |
0 |
Túi hồng thêu dâu |
22921 |
28162 |
79920 |
1 |
Hoa hướng dương |
23304 |
32286 |
80847 |
1 |
Túi to |
23708 |
36464 |
82260 |
1 |
Xuân Xanh |
23771 |
16847 |
82559 |
1 |
Màu Đậm |
23772 |
16847 |
82561 |
1 |
Hoa cúc vàng |