Database / Weaviate Vector database Interview questions
How do you choose between PQ, BQ, SQ, and RQ quantization?
Each compression technique trades off training requirements, compression ratio, and recall retention slightly differently, and Weaviate's own guidance points toward a fairly clear default recommendation while leaving room for specific alternatives.
- RQ (recommended starting point) - no training needed, strong recall retention, available in 8-bit (moderate compression) and 1-bit (aggressive compression) variants; the sensible default for most new collections.
- BQ - also training-free and very fast, but generally less accurate than 1-bit RQ, which was specifically designed as a more robust successor to it.
- PQ - requires training on sample data (10,000-100,000 objects per shard recommended) but can be tuned for strong recall at a given compression level once trained; worth considering when RQ's compression/recall trade-off doesn't quite fit a specific dataset's characteristics.
- SQ - also requires training (100,000 objects per shard by default) and uses an over-fetch-then-rescore strategy internally to boost recall.
In practice, starting with RQ and only reaching for PQ or SQ if benchmarking against real data shows a specific, measurable recall or compression benefit for that particular dataset is a reasonable default strategy, since it avoids the added operational complexity of managing a training phase unless there's a concrete reason to.
More Related questions...