COSINE_DISTANCE

Purpose

COSINE_DISTANCE is a shorthand version of the VECTOR_DISTANCE function that calculates the distance between two vectors. It takes two vectors as input and returns the distance between them as a BINARY_DOUBLE.

Parameters

  • expr1 and expr2 must evaluate to vectors and have the same number of dimensions.

  • COSINE_DISTANCE returns NULL, if either expr1 or expr2 is NULL, or if the dimensions between the two vectors do not match up.