Notes26aiVector SearchSQL

HNSW product quantization in Oracle AI Database 26ai: picking the compression ratio

Oracle AI Database 26ai (RU 23.26.4) adds HNSW product quantization: compress a vector index at a ratio you choose, from 2 to 128.

HNSW vector indexes are fast, but they live in memory, and big embedding tables get expensive. Release Update 23.26.4 of Oracle AI Database 26ai adds product-quantized HNSW indexes to solve that. Turning it on is one clause. Choosing the ratio is the real work.

What to know

  • Add QUANTIZATION PRODUCT COMPRESSION RATIO n to CREATE VECTOR INDEX, with n from 2 to 128.
  • The index stores compact centroid IDs instead of full vector values.
  • RESCORE FACTOR (1 to 100) re-ranks a larger candidate set with the original vectors. You can set it on the index or per query.
  • Supported formats are FLOAT32 and FLOAT64, with cosine, Euclidean or Euclidean squared distance. Not every ratio fits every format and dimension count.
  • The same update lists scalar-quantized global IVF indexes and multi-vector search using HNSW indexes.

Pick the ratio from your data

On a copy of your table, try 8, 16 and 32 one at a time. Run 50 real queries and compare each query's top 10 results with an unquantized index. Raise RESCORE FACTOR only if the results differ.

My take: compression trades memory for accuracy, and only your own queries can tell you where that trade stops being worth it. Source: Product-quantized HNSW indexes.

Get the Oracle + AI digest

One email when a new tested guide, template or APEX release note lands — English or Arabic. No spam; unsubscribe anytime.