TD_HNSW Function | HNSW | Teradata Vantage - TD_HNSW - Teradata VantageCloud Lake

Lake - Analyze Your Data with ClearScape Analytics™

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2026-02-20
dita:mapPath
tcl1683670667798.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
tcl1683670667798

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.

TD_HNSW also supports the following operations:
  • 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.
Support has been extended to include Vector32 and SIMD (Single Instruction, Multiple Data).
  • 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.