Query time 0.00103
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "35.77"
},
"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",
"used_key_parts": [
"feature_id",
"product_id"
],
"key_length": "6",
"rows_examined_per_scan": 20,
"rows_produced_per_join": 19,
"filtered": "99.46",
"using_index": true,
"cost_info": {
"read_cost": "5.79",
"eval_cost": "3.98",
"prefix_cost": "9.77",
"data_read_per_join": "15K"
},
"used_columns": [
"feature_id",
"product_id",
"variant_id",
"lang_code"
],
"attached_condition": "((`danishecarter_jan_demo`.`pfv`.`feature_id` in (550,551,548,549)) and (`danishecarter_jan_demo`.`pfv`.`product_id` in (459,455,438,437,445)) and (`danishecarter_jan_demo`.`pfv`.`lang_code` = 'en'))"
}
},
{
"table": {
"table_name": "fv",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"feature_id"
],
"key": "PRIMARY",
"used_key_parts": [
"variant_id"
],
"key_length": "3",
"ref": [
"danishecarter_jan_demo.pfv.variant_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "8.93",
"cost_info": {
"read_cost": "19.89",
"eval_cost": "0.36",
"prefix_cost": "33.64",
"data_read_per_join": "2K"
},
"used_columns": [
"variant_id",
"feature_id",
"position"
],
"attached_condition": "(`danishecarter_jan_demo`.`fv`.`feature_id` = `danishecarter_jan_demo`.`pfv`.`feature_id`)"
}
},
{
"table": {
"table_name": "fvd",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"variant_id",
"lang_code"
],
"key_length": "9",
"ref": [
"danishecarter_jan_demo.pfv.variant_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.78",
"eval_cost": "0.36",
"prefix_cost": "35.77",
"data_read_per_join": "5K"
},
"used_columns": [
"variant_id",
"variant",
"lang_code"
]
}
}
]
}
}
Result
feature_id |
product_id |
variant_id |
position |
variant |
548 |
437 |
1202 |
0 |
S |
548 |
438 |
1202 |
0 |
S |
548 |
445 |
1202 |
0 |
S |
549 |
437 |
1201 |
4 |
White |
549 |
438 |
1200 |
3 |
Black |
550 |
455 |
1206 |
0 |
Red1 |
550 |
459 |
1211 |
0 |
Green1 |
551 |
455 |
1209 |
0 |
Long1 |