Hierarchical Navigable Small World (HNSW) is a graph-based algorithm that performs approximate nearest neighbor searches in vector databases.
It uses a multi-layered graph structure to efficiently search high-dimensional spaces. The top layer has a sparse graph with long-range connections, and the lower layers become denser. The search starts at the top layer, then moves down through the layers to find the nearest neighbors.
The TD_HNSW function generates the HNSW graph using the input data points which is then used by TD_HNSWPredict for determining the approximate nearest neighbors for any given input data point.
- Update: Insertion of new nodes into an existing HNSW graph, constructed using TD_HNSW.
- Delete: Deletion of nodes from an existing HNSW graph, constructed using TD_HNSW.
- Vector32 is a user-defined type (UDT) similar to Vector; both are designed to handle vector data. However, they differ in their internal data types: Vector uses the double data type to store values, while Vector32 uses float to optimize memory usage.
TD_HNSW supports Vector32 as a target column in the same way it supports Vector.
SIMD is a type of parallel computing architecture where a single instruction is executed simultaneously across multiple data points. It allows processors to perform the same operation on multiple pieces of data at once, improving performance for tasks such as graphics processing, scientific computations, and machine learning.
TD_HNSW supports SIMD, and the corresponding instruction set is executed when Use SIMD is enabled and compiler support is detected. See Optional Syntax Elements for TD_HNSW.