Expand description
Access-path signal for CQL SELECT execution (Issue #960, Epic #951).
§Why this exists
Correct result rows do not prove that a storage-layer prune/seek
capability is actually wired into the CQL execution path. #949 returned the
right rows while still scanning every SSTable and filtering in memory. Tests,
reviewers, and (eventually) EXPLAIN output need an explicit, assertable
signal for the access path a SELECT chose, so that an accidental fallback
to a full scan cannot masquerade as a targeted lookup.
This module exposes:
AccessPath— a closed enum describing the access path a SELECT surface selected. Downstream issues (#958 work counters, #962 fast-path unification) consume this same enum, so the variant names are part of the public contract.FallbackReason— a documented closed set of reasons a SELECT fell back to a full scan. Recording an honest reason here is mandatory: a path that still full-scans today MUST reportAccessPath::FullScanorAccessPath::FallbackFullScan, never a fake targeted path.- A process-global probe (
record,last,reset) that mirrors thescan_for_key_call_countpattern (issue #831). Because the streaming SELECT path executes inside a spawned task (a different thread), the probe is a process-global rather than a thread-local — that is the only mechanism observable from both the materializing and streaming paths and from an integration test without parsing logs. It is stored lock-free viaarc_swap::ArcSwapOption(issue #1595): the signal was written on every SELECT, so aMutexhere was a process-wide serialization point (and a lock-poisoning surface) with no functional need.
§Scope (per #960)
#960 only exposes and reports the path; it does not make every path
targeted (that is #962 for the single-key metadata lookup and #1916 for the
metadata IN (...) fan-out). The reported path must be honest — a metadata
projection with no usable restriction still reports an honest
AccessPath::FallbackFullScan, never a faked targeted path.
Enums§
- Access
Path - The access path a
SELECTsurface selected for a single SSTable-scan step. - Fallback
Reason - The documented, closed set of reasons a
SELECTfell back to a full scan.
Functions§
- last
- Read the most recently recorded access path, or
Noneif none was recorded since the lastreset. - record
- Record the access path chosen by a SELECT SSTable-scan step.
- reset
- Clear the recorded access path. Tests call this before a query so a stale value from a previous query cannot satisfy the assertion.