Query time 0.00125
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "22.09"
},
"nested_loop": [
{
"table": {
"table_name": "v",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"fl",
"product_id",
"fpl",
"idx_product_feature_variant_id"
],
"key": "PRIMARY",
"used_key_parts": [
"feature_id",
"product_id"
],
"key_length": "6",
"rows_examined_per_scan": 24,
"rows_produced_per_join": 24,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "2.89",
"eval_cost": "2.40",
"prefix_cost": "5.29",
"data_read_per_join": "18K"
},
"used_columns": [
"feature_id",
"product_id",
"variant_id"
],
"attached_condition": "((`cscartdb`.`v`.`feature_id` = 1466) and (`cscartdb`.`v`.`product_id` in ('57923','63581','63580','63579','63578','63577','63576','63575','63574','63573','63572','63571','63570','63569','63568','63567','63566','63565','63564','63563','63562','63561','63560','63559')))"
}
},
{
"table": {
"table_name": "vd",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"variant_id",
"lang_code"
],
"key_length": "9",
"ref": [
"cscartdb.v.variant_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 24,
"filtered": "100.00",
"cost_info": {
"read_cost": "6.00",
"eval_cost": "2.40",
"prefix_cost": "13.69",
"data_read_per_join": "72K"
},
"used_columns": [
"variant_id",
"variant",
"lang_code"
]
}
},
{
"table": {
"table_name": "vf",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"variant_id"
],
"key_length": "3",
"ref": [
"cscartdb.v.variant_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 24,
"filtered": "100.00",
"cost_info": {
"read_cost": "6.00",
"eval_cost": "2.40",
"prefix_cost": "22.09",
"data_read_per_join": "27K"
},
"used_columns": [
"variant_id",
"color",
"position"
]
}
}
]
}
}
Result
variant_id |
product_id |
variant |
position |
color |
5884 |
57923 |
Red |
0 |
#ff0000 |
5884 |
63559 |
Red |
0 |
#ff0000 |
5884 |
63560 |
Red |
0 |
#ff0000 |
5884 |
63561 |
Red |
0 |
#ff0000 |
5885 |
63562 |
Black |
1 |
#000000 |
5885 |
63563 |
Black |
1 |
#000000 |
5885 |
63564 |
Black |
1 |
#000000 |
5885 |
63565 |
Black |
1 |
#000000 |
5886 |
63566 |
Purple |
2 |
#9900ff |
5886 |
63567 |
Purple |
2 |
#9900ff |
5886 |
63568 |
Purple |
2 |
#9900ff |
5886 |
63569 |
Purple |
2 |
#9900ff |
5887 |
63570 |
Pink |
3 |
#ffd1f2 |
5887 |
63571 |
Pink |
3 |
#ffd1f2 |
5887 |
63572 |
Pink |
3 |
#ffd1f2 |
5887 |
63573 |
Pink |
3 |
#ffd1f2 |
5888 |
63574 |
White |
4 |
#ffffff |
5888 |
63575 |
White |
4 |
#ffffff |
5888 |
63576 |
White |
4 |
#ffffff |
5888 |
63577 |
White |
4 |
#ffffff |
5889 |
63578 |
Blue |
5 |
#0000ff |
5889 |
63579 |
Blue |
5 |
#0000ff |
5889 |
63580 |
Blue |
5 |
#0000ff |
5889 |
63581 |
Blue |
5 |
#0000ff |