OriginChainDB
Vector search

Vector quantization.

Quantization stores vectors in a smaller representation. It can reduce memory, but the search may lose some precision. Compare compressed results with an uncompressed baseline before choosing a configuration.

Measure the cost of smaller vectorsUse only supported metric and compression combinations; keep raw vectors unless you deliberately choose otherwise.
  1. Measure an uncompressed baselineRecord memory, query time and nearest-neighbor results.
  2. Choose supported compressionCheck binary or PQ options against your metric and deployment.
  3. Build from representative dataVerify the installed configuration and retained-vector setting.
  4. Compare quality and total memoryInclude index overhead and missed neighbors in the decision.

The trade table.

RepresentationWhat changesWhat to measure
Float32Keeps each coordinate as a 32-bit value.Baseline memory and result quality.
BinaryStores a compact bit representation.Missed neighbors and any reranking cost.
Product quantization (PQ)Stores short codes for parts of a vector.Codebook overhead, recall and update cost.
IVF-PQCombines grouped search with compressed residuals.Group probing, recall and total index memory.

Check your deployed capabilities before selecting a representation. Binary quantization is supported with cosine; incompatible dot, L2 or Manhattan combinations are refused. Raw-code size is not total database memory.

Pick one at install.

Use the documented runtime configuration for the vector collection. The schema’s dimension and distance declarations are separate from compression settings. A made-up manifest key does not configure an index.

Confirm the installed index configuration before comparing query results.

Train a PQ codebook.

A codebook is a learned set of representative vector parts. Train it with vectors that resemble the records you will search. Use the documented IVF-PQ build endpoint; there is no install-pq request in this guide's API contract.

Prepare a sufficiently large stored corpus first; the three-value quickstart alone is not a training dataset. With the explicit endpoint settings from API authentication, the request is:

curl --fail-with-body -X POST "$OC_BASE_URL/v1/tenants/$OC_TENANT/vector/embeddings/create-ivf-pq-index" \
  -H "Authorization: Bearer $OC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"preset":"compressed","seed":42,"drop_raw_vectors":false}'

This trains and installs a compressed index from the existing embeddings collection on a supported deployment. Check trained, installed and raw_vectors_retained in the response. The request keeps the original vectors. Setting drop_raw_vectors: true is an irreversible, separate choice; read the build API before using it.

Memory math.

At 128 dimensions, float32 coordinates use 512 bytes per vector. A 128-bit binary representation uses 16 bytes. Sixteen 8-bit PQ codes also use 16 bytes for the codes alone.

Total memory includes codebooks, identifiers, centroids and index structures. Measure that total rather than quoting the raw-code ratio as database-wide savings. Continue with IVF or vector search.

© 2026 Silicoyn Technologies Pvt Ltd

On this page