Query time 0.01594
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": 121,
"filtered": 0.025262915,
"attached_condition": "pfv.feature_id in (23485,21323,23236,19782,23234,21324,21893,21322,23235,20462,24054) and pfv.product_id in (33744,1980,31639,15462,31636,1979,1088,1981,31637,3876,40149) 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 |
21893 |
1088 |
76637 |
0 |
Tròn xanh than hoa đỏ |
21324 |
1979 |
74596 |
3 |
Túi Zip |
21323 |
1980 |
74593 |
0 |
Túi Zip |
21322 |
1981 |
74590 |
0 |
Túi Zip |
20462 |
3876 |
71574 |
0 |
Trâu con |
19782 |
15462 |
68795 |
0 |
Bánh gạo lứt Yến mạch |
23234 |
31636 |
80580 |
1 |
60g |
23235 |
31637 |
80582 |
1 |
45g |
23236 |
31639 |
80584 |
1 |
70g |
23485 |
33744 |
81495 |
1 |
100g |
24054 |
40149 |
83821 |
1 |
Mẫu 1 |