K nearest neighbor is a proximity algorithm to find data in order of distance. Typically, this data cannot be indexed in advance, as both the centroid and the data can be in constant motion. PostgreSQL provides efficient searching algorithms for finding proximity data on the fly, including unique high-performance indexing options.
In this webinar, Kirk Roybal talked about the following topics:
- What is K-nearest neighbor?
- What can I do with it?
- What kinds of data can I search for?
- How expensive is it to the query planner?
- How do I minimize that cost?