Performance and Limits

Vector search in DianaDB is exact: every vector of the field is compared with the query vector, so the results are always the true nearest ones. There is no approximate index (HNSW or similar) yet.

Search speed

The time grows with the number of vectors times their dimensions. Measured on one core: about 130 ms per query for 100,000 vectors of 768 dimensions. Roughly:

Vectors × dimensionsPer query, about
10,000 × 384under 10 ms
100,000 × 38465 ms
100,000 × 768130 ms
100,000 × 1536260 ms

Only the 100,000 × 768 row is measured; the others are scaled from it and depend on the machine. The search runs on the server's event loop, so other requests wait while it runs. Up to about 100,000 vectors per field works well for interactive use.

Memory

Each vector takes 8 bytes per dimension in memory (64-bit floats), plus a small fixed overhead: a 768-dimension vector is about 6 KB, so 100,000 of them take about 600 MB. Plan the server's memory with this in mind; the memory guard refuses writes when memory runs low.

Limits

  • dimensions is fixed per field: every stored and query vector must have exactly that many numbers.
  • Values must be finite numbers; NaN and Infinity are refused.
  • Vectors can't be compared with $eq, $gt or similar; use $neighbors or $direction.
  • Each vector is written on one line of the dump file (base64), so snapshot size grows with the vectors too.

Keeping searches fast

  • Prefer a smaller model: 384 dimensions searches twice as fast as 768 and takes half the memory.
  • Split the data: one collection per tenant or category keeps each search small.
  • Keep count reasonable; it affects the result size more than the search time.