Query time 0.00293
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": 30,
"filtered": 51.5835762,
"attached_condition": "pfv.feature_id in (24836,25022,25110,25100,25143,25142) and pfv.product_id in (47652,50045,50163,50345,50341) 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 |
24836 |
47652 |
86606 |
1 |
Mẫu vẽ hoa sen ngẫu nhiên |
25022 |
50045 |
87281 |
0 |
Đậm |
25022 |
50163 |
87281 |
0 |
Đậm |
25100 |
50163 |
87628 |
2 |
Size A4 |
25110 |
50045 |
87658 |
0 |
Size A4 |
25142 |
50341 |
87764 |
1 |
Tranh 1 người |
25143 |
50345 |
87768 |
1 |
Tranh 1 người |