docs/internals/adr/gaps/008-no-high-query-rate-optimization.md
Status: Open Discovered: 2026-02-19 Context: Cloud-native storage characteristics analysis (high query rate optimization)
Quickwit's metadata and query infrastructure is not optimized for the high query rates required by monitor evaluation at scale. Large-scale observability platforms can require hundreds of thousands of queries per second for monitor evaluation alone. At this scale, the metadata service must respond to split-listing queries with sub-millisecond latency, and query results for repeated predicates must be cacheable to avoid redundant computation.
The current metadata service is PostgreSQL. While PostgreSQL handles moderate query planning loads, it is not designed for very high QPS of metadata lookups with the per-split min/max/regex filtering that split-level pruning requires (see GAP-004). Each monitor evaluation cycle queries the metastore for relevant splits, evaluates the query, and discards the result. The next cycle repeats the same work.
The metrics pipeline stores split metadata in PostgreSQL (metrics_splits table). Query planning queries this table to find splits matching a time range and tag predicates. PostgreSQL handles this at current scale (low query rate, limited metadata), but the design does not address:
ADR-003 explicitly acknowledges the PostgreSQL scalability concern: "At high ingestion rates, PostgreSQL metadata volume can exceed what a single OLTP database handles efficiently."
Metrics: Most affected. Monitor evaluation drives the highest query rate.
Traces and logs: Less affected for monitors, but dashboard queries at scale face the same metadata bottleneck.
quickwit-metastore, quickwit-search (query planning), metadata infrastructure