Query time 0.04625
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": 371,
"filtered": 0.035409119,
"attached_condition": "pfv.feature_id in (21226,21019,21038,21025,19997,20318,21626,21016,19661,24707,24708,20637,20002,21026,19682,24056,22406,21223,24045) and pfv.product_id in (2135,2507,21065,2501,5568,4305,23162,2510,6533,46739,3447,16601,2500,6466,40153,306,2138,40143) 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 |
19661 |
6533 |
68377 |
0 |
100g |
19682 |
6466 |
68431 |
0 |
200g |
19997 |
5568 |
69896 |
0 |
Nguyên hạt |
20002 |
16601 |
69910 |
0 |
Nguyên hạt |
20318 |
4305 |
71072 |
0 |
Size lớn |
20637 |
3447 |
72138 |
0 |
Chai lẻ |
21016 |
2510 |
73422 |
0 |
Lon lẻ |
21019 |
2507 |
73431 |
0 |
Chai lẻ |
21025 |
2501 |
73449 |
0 |
Chai lẻ |
21026 |
2500 |
73452 |
0 |
Chai lẻ |
21038 |
21065 |
73489 |
0 |
Combo 4 lon |
21223 |
2138 |
74236 |
0 |
Chai lẻ |
21226 |
2135 |
74248 |
0 |
Chai lẻ |
21626 |
23162 |
75635 |
0 |
Màu Xanh Rêu |
22406 |
306 |
78572 |
0 |
Xanh lá |
24045 |
40143 |
83773 |
1 |
Model 1 |
24056 |
40153 |
83826 |
1 |
Mẫu 1 |
24707 |
46739 |
86178 |
1 |
250g |
24708 |
46739 |
86180 |
1 |
Nguyên Hạt |