Skip to main content
Configure StreamingDiskANN query behavior at runtime to dynamically tune the accuracy vs performance trade-off for individual queries or sessions.
  • Adjust accuracy and speed trade-offs per query
  • Fine-tune search quality without rebuilding indexes
  • Optimize for different use cases (fast approximate vs high-accuracy search)
  • Control rescoring behavior for better accuracy

Samples

Increase accuracy for important queries

Disable rescoring for maximum speed

Session-wide configuration

Parameters

diskann.query_search_list_size

Controls the size of the candidate list during graph traversal:
  • Lower values (20-50): Faster queries, reduced accuracy, fewer candidates explored
  • Default (100): Balanced performance and accuracy
  • Higher values (100-200): Better accuracy, slower queries, more thorough search
This parameter has the most direct impact on the accuracy/speed trade-off.

diskann.query_rescore

The number of top candidates to rescore using full-precision vectors:
  • 0: Disable rescoring, use quantized results directly (fastest)
  • Default (50): Rescore top 50 candidates for improved accuracy
  • Higher values (50-200): More thorough rescoring, better accuracy, slower queries
Rescoring helps correct errors introduced by quantization in memory-optimized indexes. For plain storage indexes, rescoring has minimal effect.

Setting parameters

Session-level (persistent)

Applies to all queries in the current session until changed or the session ends.

Transaction-local (temporary)

The LOCAL keyword ensures parameters reset after the transaction ends.

Tuning recommendations

High-accuracy applications

For applications where accuracy is critical (e.g., medical diagnosis, legal document search):

Real-time applications

For latency-sensitive applications (e.g., chatbots, autocomplete):

Batch processing

For offline batch processing where throughput matters:

A/B testing different configurations

Performance considerations

  • Start with default values and adjust diskann.query_rescore first
  • Use transaction-local settings (SET LOCAL) for experimentation
  • Monitor query latency with EXPLAIN ANALYZE when tuning
  • Higher values consume more CPU but not significantly more memory