Query time 0.00128
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "51.58"
},
"nested_loop": [
{
"table": {
"table_name": "pfv",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"fl",
"variant_id",
"lang_code",
"product_id",
"fpl"
],
"key": "PRIMARY",
"used_key_parts": [
"feature_id",
"product_id"
],
"key_length": "6",
"rows_examined_per_scan": 44,
"rows_produced_per_join": 24,
"filtered": "56.37",
"using_index": true,
"cost_info": {
"read_cost": "15.37",
"eval_cost": "4.96",
"prefix_cost": "20.33",
"data_read_per_join": "19K"
},
"used_columns": [
"feature_id",
"product_id",
"variant_id",
"lang_code"
],
"attached_condition": "((`portal`.`pfv`.`feature_id` in (73,74)) and (`portal`.`pfv`.`product_id` in (2394,2399,2403,2020,2032,2042,2058,1848,1856,1868,1878,1886)) and (`portal`.`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": [
"portal.pfv.variant_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "5.00",
"cost_info": {
"read_cost": "24.80",
"eval_cost": "0.25",
"prefix_cost": "50.10",
"data_read_per_join": "1K"
},
"used_columns": [
"variant_id",
"feature_id",
"position"
],
"attached_condition": "(`portal`.`fv`.`feature_id` = `portal`.`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": [
"portal.pfv.variant_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.24",
"eval_cost": "0.25",
"prefix_cost": "51.58",
"data_read_per_join": "3K"
},
"used_columns": [
"variant_id",
"variant",
"lang_code"
]
}
}
]
}
}
Result
feature_id |
product_id |
variant_id |
position |
variant |
73 |
1848 |
9802 |
0 |
M |
73 |
1856 |
9802 |
0 |
M |
73 |
1868 |
9801 |
0 |
S |
73 |
1878 |
9801 |
0 |
S |
73 |
1886 |
9802 |
0 |
M |
73 |
2020 |
9802 |
0 |
M |
73 |
2032 |
9802 |
0 |
M |
73 |
2042 |
9802 |
0 |
M |
73 |
2058 |
9801 |
0 |
S |
73 |
2394 |
9804 |
0 |
XL |
73 |
2399 |
9802 |
0 |
M |
73 |
2403 |
9801 |
0 |
S |
74 |
1848 |
9866 |
0 |
Blue |
74 |
1856 |
9864 |
0 |
White |
74 |
1868 |
9865 |
0 |
Black |
74 |
1878 |
9866 |
0 |
Blue |
74 |
1886 |
9864 |
0 |
White |
74 |
2020 |
9866 |
0 |
Blue |
74 |
2032 |
9899 |
0 |
Red |
74 |
2042 |
9899 |
0 |
Red |