Query time 0.00057
JSON explain
{
"query_block": {
"select_id": 1,
"cost": 0.01801512,
"nested_loop": [
{
"read_sorted_file": {
"filesort": {
"sort_key": "a.position, a.variant_id",
"table": {
"table_name": "a",
"access_type": "ref",
"possible_keys": ["status", "option_id", "option_id_2"],
"key": "option_id",
"key_length": "6",
"used_key_parts": ["option_id", "status"],
"ref": ["const", "const"],
"loops": 1,
"rows": 5,
"cost": 0.00743232,
"filtered": 100,
"index_condition": "a.`status` = 'A'",
"attached_condition": "a.option_id <=> 2 and a.`status` <=> 'A'"
}
}
}
},
{
"table": {
"table_name": "b",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "9",
"used_key_parts": ["variant_id", "lang_code"],
"ref": ["lvshop.a.variant_id", "const"],
"loops": 5,
"rows": 1,
"cost": 0.0052914,
"filtered": 100,
"attached_condition": "trigcond(b.lang_code = 'en')"
}
},
{
"table": {
"table_name": "shared_option_variants",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "company_id"],
"key": "PRIMARY",
"key_length": "7",
"used_key_parts": ["variant_id", "company_id"],
"ref": ["lvshop.a.variant_id", "const"],
"loops": 5,
"rows": 1,
"cost": 0.0052914,
"filtered": 100
}
}
]
}
}
Result
| variant_name |
variant_id |
option_id |
position |
modifier |
modifier_type |
weight_modifier |
weight_modifier_type |
point_modifier |
point_modifier_type |
status |
| Small |
6 |
2 |
10 |
0.000 |
A |
0.000 |
A |
0.000 |
A |
A |
| Medium |
10 |
2 |
20 |
0.000 |
A |
0.000 |
A |
0.000 |
A |
A |
| Large |
9 |
2 |
30 |
0.000 |
A |
0.000 |
A |
0.000 |
A |
A |
| X Large |
8 |
2 |
40 |
0.000 |
A |
0.000 |
A |
0.000 |
A |
A |
| XX Large |
7 |
2 |
50 |
0.000 |
A |
0.000 |
A |
0.000 |
A |
A |