Query time 0.04387
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": 251,
"filtered": 0.022846738,
"attached_condition": "pfv.feature_id in (21383,24240,24063,22348,21225,21024,20006,21229,20004,19999,21013,21228,21018,20262,21226) and pfv.product_id in (1897,33214,46181,382,2136,2502,5551,2132,5553,5567,2513,2133,2508,18260,2135) 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 |
19999 |
5567 |
69904 |
0 |
Xay - Pha phin |
20004 |
5553 |
69918 |
0 |
Xay mịn espresso |
20006 |
5551 |
69924 |
0 |
Xay mịn espresso |
20262 |
18260 |
70900 |
0 |
Pop art 1 |
21013 |
2513 |
73413 |
0 |
Chai lẻ |
21018 |
2508 |
73428 |
0 |
Lon lẻ |
21024 |
2502 |
73446 |
0 |
Chai lẻ |
21225 |
2136 |
74244 |
0 |
Chai lẻ |
21226 |
2135 |
74248 |
0 |
Chai lẻ |
21228 |
2133 |
74256 |
0 |
Chai lẻ |
21229 |
2132 |
74260 |
0 |
Chai lẻ |
21383 |
1897 |
74795 |
0 |
Hạt gỗ 6 ly (1 vòng) |
22348 |
382 |
78331 |
0 |
Set 3 Thanh |
24063 |
46181 |
83856 |
2 |
Mẫu 2 |
24240 |
33214 |
84462 |
1 |
Mẫu 1 |