Database / Weaviate Vector database Interview questions
When should you use the Dynamic index instead of always using HNSW?
Always using HNSW, even for very small collections or individual tenant partitions, means paying the overhead of building and maintaining a graph structure even when a small collection's data would search perfectly fast with plain brute-force comparison. The Dynamic index avoids that unnecessary overhead by starting with Flat and only upgrading to HNSW once it's actually worthwhile.
The Dynamic index becomes the clear choice specifically for multi-tenant collections where tenant sizes vary widely and unpredictably: rather than a single fixed index-type decision applied uniformly to every tenant regardless of their actual data volume, each tenant's partition independently starts small and cheap, then transitions to HNSW automatically if and when it genuinely grows large enough to benefit.
For a single, non-multi-tenant collection whose expected size is already known in advance, either explicitly choosing Flat (if it's confidently going to stay small) or HNSW directly (if it's confidently going to grow large) is often simpler to reason about than Dynamic's automatic threshold-based switching, since Dynamic's main value is specifically handling uncertainty or wide variance in data volume, which a collection with a well-known, stable size doesn't actually have.
More Related questions...