Skip to content

Latest commit

 

History

History
15 lines (8 loc) · 3.72 KB

bounded-reads.md

File metadata and controls

15 lines (8 loc) · 3.72 KB

Bounded search and graph reads

Public query, search, graph and bulk-read requests are not throttled by request count or reserved bytes (ADR-145) and have no configured operation limits (ADR-149); the server-wide request body limit bounds their input. Inside a search or graph read, ReadExecutionBudget accounts raw-read bytes and examined records across the whole storage cut and stops on the caller's cancellation token and on explicit expiries.

There is no default read-byte budget and no fixed execution deadline: the request envelope's ExpiresAt and caller-supplied expiries are the only time bounds. Accounting includes returned raw keys/values from scans and point reads. Vector sidecar scans charge their referenced canonical documents too; graph adjacency scans charge edge and vertex dereferences. Missing, hidden, stale and filtered records still count as the work needed to examine them. Text and vector branches share the same ledger and the same authorized read gate. HTTP request cancellation reaches search and graph execution; checks occur between reads, scores, projections and text-token batches. An in-progress synchronous storage lock or serialization is not preempted.

Graph MaxEdges bounds the total examined adjacency records across the traversal, including label-filtered and hidden destinations. It is not a fresh per-vertex allowance. Depth and vertex caps also apply. Labels use an ordinal set; a hidden intermediate vertex is never expanded. Search and graph responses are bounded by the grain reply ceiling (GrainRoutingOptions.MaximumReplyBytes) and, when configured, by QueryExecutionOptions.MaximumResultBytes, measured on the complete serialized protocol result, including identity, revision, scores and edge/vertex metadata.

Exact BM25 reads the visible corpus while retaining document lengths and counts for query terms only. It does not retain an array of every corpus word or repeatedly count each query term across those arrays. NFKC normalization, invariant rune casing, visible-corpus document frequencies, repeated-term counts and the original BM25 constants remain unchanged. Query-term order controls floating-point score accumulation; score ties use canonical document ID. There is no corpus-wide token cap; QueryExecutionOptions limits each document to 65,536 tokens (MaximumDocumentWords) and each token to 4,096 characters (MaximumWordCharacters). Missing text fields still participate in the visible corpus's document count and average-length policy. Only selected fused results receive full returned-document projection.

Text and exact-vector ranks use weighted RRF with one-based ranks. Its denominator is calculated in floating point so a large valid FusionConstant cannot wrap an integer into a negative score. Current row, field-use and returned-field policies continue to apply under the same read gate.

Tests use the real store to prove point-dereference byte accounting, shared hybrid accounting, Unicode/repeated-term BM25 ranks, filtered and hidden graph work limits, complete result byte accounting and cancellation without canonical mutations. A monotonic test clock exercises explicit-expiry exhaustion without freezing the Orleans host clock.

Storage still bounds each range operation by its provider page (ZoneTreeStorageExecutionOptions.MaximumRangeRecords, default 100,000, and MaximumRangeWorkBytes, default 64 MiB); a read that needs a complete range pages through it instead of failing. Object/JSON allocations can exceed the raw byte count. Memory, process RSS, storage cache/memtable sizes, disk floors and sustained/endurance qualification remain separate work. Managed ANN and distributed ranking are separate search profiles.