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 × dimensions | Per query, about |
|---|---|
| 10,000 × 384 | under 10 ms |
| 100,000 × 384 | 65 ms |
| 100,000 × 768 | 130 ms |
| 100,000 × 1536 | 260 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
dimensionsis fixed per field: every stored and query vector must have exactly that many numbers.- Values must be finite numbers;
NaNandInfinityare refused. - Vectors can't be compared with
$eq,$gtor similar; use$neighborsor$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
countreasonable; it affects the result size more than the search time.