Query time 0.02031
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": "idx_product_feature_variant_id",
"key_length": "12",
"used_key_parts": ["product_id", "feature_id", "lang_code"],
"rows": 190,
"filtered": 0.442892045,
"attached_condition": "pfv.feature_id in (20263,24867,24727,22298,24606,24757,21727,24758,22626,23526,24568,24569,23528,25064) and pfv.product_id in (18264,47974,46982,464,45446,47163,1323,47162,27262,35166,44945,35169,41292) 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 |
22298 |
464 |
78147 |
4 |
Domino Đen |
21727 |
1323 |
75974 |
0 |
Vàng |
20263 |
18264 |
70905 |
0 |
Almond Blossom |
22626 |
27262 |
79252 |
0 |
Pick Me |
23526 |
35166 |
81655 |
1 |
Bông tai |
23528 |
35169 |
81660 |
1 |
Bông tai |
25064 |
41292 |
87455 |
0 |
Size S |
24568 |
44945 |
85749 |
1 |
Trắng |
24569 |
44945 |
85757 |
1 |
Size S |
24606 |
45446 |
85872 |
10 |
Summer tea |
24727 |
46982 |
86256 |
1 |
Màu xanh |
24758 |
47162 |
86334 |
1 |
Màu nâu nhạt |
24757 |
47163 |
86331 |
1 |
Màu nâu |
24867 |
47974 |
86716 |
1 |
Mẫu 1 |