In Oracle Database 23ai, vector distance calculations are primarily handled by the VECTOR_DISTANCE function, which supports multiple metrics (e.g., COSINE, EUCLIDEAN) specified as parameters (e.g., VECTOR_DISTANCE(v1, v2, EUCLIDEAN)). However, the question implies distinct functions, a common convention in some databases or libraries, and Oracle’s documentation aligns L2_DISTANCE (B) with the Euclidean metric. L2 (Euclidean) distance is the straight-line distance between two points in vector space, computed as √∑(xi - yi)², where xi and yi are vector components. For example, for vectors [1, 2] and [4, 6], L2 distance is √((1-4)² + (2-6)²) = √(9 + 16) = 5.
Option A, L1_DISTANCE, represents Manhattan distance (∑|xi - yi|), summing absolute differences—not Euclidean. Option C, HAMMING_DISTANCE, counts differing bits, suited for binary vectors (e.g., INT8), not continuous Euclidean spaces typically used with FLOAT32 embeddings. Option D, COSINE_DISTANCE (1 - cosine similarity), measures angular separation, distinct from Euclidean’s magnitude-inclusive approach. While VECTOR_DISTANCE is the general function in 23ai, L2_DISTANCE may be an alias or a contextual shorthand in some Oracle AI examples, reflecting Euclidean’s prominence in geometric similarity tasks. Misinterpreting this could lead to choosing COSINE for spatial tasks where magnitude matters, skewing results. Oracle’s vector search framework supports Euclidean via VECTOR_DISTANCE, but B aligns with the question’s phrasing.
[Reference:Oracle Database 23ai SQL Language Reference, Section on VECTOR_DISTANCE; AI Vector Search Guide, Distance Metrics., , ]