k-nearest-neighbour (kNN) search functionality is a way to find entries based on their distance to a specific vector.
The general function syntax for kNN is:
distance(<target column>, <vector to compare with>, <metric> [, <weights>]).
To express a k-Nearest-Neighbour search in SQL, you can combine the
distance function with a
ORDER BY clause.
Currently the following metrics are supported:
- L2 squared