The same original rows can have a different nearest neighbor when one feature scale changes. This lesson keeps both squared-distance calculations exact for one query.
highlighted = computed this step
Raw distances
Use query Q=(0, 6), Red point R=(1, 0), and Blue point B=(4, 10). The raw squared distances are 37 to Red and 32 to Blue, so the raw nearest neighbor is Blue.
d2(Q,R)=37,d2(Q,B)=32⇒Blue
Scale y by one tenth
Now keep x unchanged and replace each y value with y divided by 10. The query becomes (0, 3/5). Red stays (1, 0), and Blue becomes (4, 1). The squared distances are 34/25 to Red and 404/25 to Blue.
dscaled2(Q,R)=34/25,dscaled2(Q,B)=404/25
Compare the nearest row
With raw coordinates, Blue is nearest. With y scaled by one tenth, Red is nearest. These are the same original rows and one exact query, but a different feature scale changes the smaller squared distance. This is not a normalization recommendation, not a model-quality claim, and not a claim about future data.