Expand description
A query to count documents using CountTree elements
Types and module structure for the GetDocumentsCount query.
The implementation is split across siblings:
- [
mode_detection] — operator classification +detect_mode. - [
index_picker] — covering-index pickers (find_countable_index_*,find_range_countable_index_*). - [
path_query] — the load-bearing prover/verifier-agreement path-query builders (aggregate_count_path_query,distinct_count_path_query,range_clause_to_query_item). - [
execute_point_lookup] — Equal/In point-lookup execution (execute_no_proof,execute_with_proof). - [
execute_range_count] — range-mode execution +RangeCountOptions. - [
drive_dispatcher] —impl Driveper-mode dispatchers +DocumentCountRequest/DocumentCountResponse+execute_document_count_request. - [
tests] (cfgserver+test) — integration tests.
This file owns the three public types every other submodule
references and the corresponding mod / pub use plumbing.
Re-exports§
pub use super::conditions::WhereOperator;pub use crate::error::query::QuerySyntaxError;pub use drive_dispatcher::DocumentCountRequest;pub use drive_dispatcher::DocumentCountResponse;pub use execute_range_count::RangeCountOptions;
Modules§
- drive_
dispatcher - Top-level dispatcher for the unified
GetDocumentsCountrequest. - execute_
point_ lookup - Equal/In point-lookup execution paths for the count query.
- execute_
range_ count - Range execution paths for the count query.
- executors
- Per-mode count-query executors on
impl Drive. One file persuper::DocumentCountModevariant — the dispatcher (super::drive_dispatcher) calls into the right one based on the detected mode. - index_
picker - Index pickers for the count query.
- mode_
detection - Mode detection + operator classification for the count query.
- path_
query - Path-query builders for the count query.
Structs§
- Drive
Document Count Query - A query to count documents using CountTree elements in the index path.
- Split
Count Entry - An entry in a split count result, containing the serialized key(s) and the count of documents matching them.
Enums§
- Count
Mode - SQL-shaped count-query mode — names the response shape the
caller asked for via
(select, group_by)on the wire. - Document
Count Mode - Classification of a count query’s shape, used to dispatch to the
right executor. Returned by
DriveDocumentCountQuery::detect_mode.
Constants§
- MAX_
CARRIER_ AGGREGATE_ OUTER_ RANGE_ LIMIT - Platform-wide maximum outer-walk cap for carrier-aggregate
range-outer proofs (chapter 30 G8:
outer_range_field > X AND inner_acor_field > Ywithgroup_by = [outer_range_field]andprove = true). - MAX_
LIMIT_ AS_ FAILSAFE - Hard cap on entries the count fan-out arms ask the executor to return.
Functions§
- counter_
sum_ as_ document_ count - A
summableOffCountIndexindex’s sum read as a document count. A counter is never negative: it counts entries. - counter_
sum_ entry_ as_ count_ entry - A sum entry read through
DriveDocumentCountQuery::counter_sums_query, as the count entry it stands for. - document_
count_ chain_ position - The position of the shallowest level of
indexwhose value trees a count read may stop at, taking the subtree’s document count: the count chain’s ([Index::shallowest_count_chain_position]), or on asummableOffCountIndexindex the sum chain’s, whose sums are its document counts.Nonewithout such a chain. - document_
count_ of_ element - The number of documents an element a count read of
indexreaches stands for: its count, or, on asummableOffCountIndexindex, its sum. Such an index keeps one counter per group, which counts one in its count trees and adds its group’s documents to their sums, and its registration rules make each counter equal its source group’s entries, so its sums are the document counts. - point_
lookup_ count_ entries - Turns the
(path, key, element)triples a point-lookup count path query yields (seepoint_lookup_count_path_query) into one entry per count tree. For compound (In) shapes theInvalue sits atpath[base_path_len]when the walk descended past the base path (theIn+ trailingEquals shape) and IS the key otherwise (theIn-on-terminator shape);Equal-only shapes have no per-key dimension. The element’s document count (document_count_of_element) is the per-branch count; an absent element becomescount: None. ONE decoder for every reader of that layout — the proof verifier, the no-proof executor and composite queries — so the layout has one owner.