Query time 0.02402
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": 196,
"filtered": 0.033488151,
"attached_condition": "pfv.feature_id in (21036,21915,22541,22696,21630,20326,22136,24142,20325,19683,20147,22669,21478,21748) and pfv.product_id in (21063,1056,79,585,23172,4271,24798,40808,4272,14982,4939,2128,1748,23481) 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 |
22541 |
79 |
79145 |
0 |
Trà Oolong Hộp Túi Gấm Màu Xanh Lá - Kim Tuyên Mùa Xuân |
22696 |
585 |
79432 |
1 |
ARABICA |
21915 |
1056 |
76710 |
0 |
Màu cam |
21478 |
1748 |
75181 |
0 |
Size Vừa |
22669 |
2128 |
79358 |
1 |
Nguyên hạt |
20326 |
4271 |
71101 |
0 |
37 |
20325 |
4272 |
71093 |
0 |
37 |
20147 |
4939 |
70492 |
0 |
Size lớn |
19683 |
14982 |
68435 |
0 |
500ml |
21036 |
21063 |
73485 |
0 |
Combo 4 chai |
21630 |
23172 |
75649 |
0 |
You & Me |
21748 |
23481 |
76046 |
0 |
Màu xanh cổ vịt |
22136 |
24798 |
77489 |
0 |
217gr |
24142 |
40808 |
84147 |
1 |
127g |