You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Skip per-split zone-mask expansion when covering zones are uniform
`ZonedReader::pruning_evaluation` expanded the cached zone-level pruning
mask into a row-aligned bit buffer for every split, then intersected it
with the incoming mask. That cost a `Vec` of zone lengths (built eagerly,
before the future was polled), a `BitBufferMut` of the full split length,
a popcount over it, and a bitand, on every split of every scan.
For most splits the zones covering that split are uniform: either none
are pruned or all of them are. Both collapse to a constant stats mask, so
counting the covered zone bits first - a handful of bit reads via
`BitBuffer::count_range` - lets us skip the expansion entirely:
- no covered zone pruned: the stats mask is all-true, so forward the
incoming mask unchanged,
- every covered zone pruned: return `Mask::new_false` directly,
- otherwise: fall through to the existing expansion.
The zone-length computation now lives on the non-uniform path, so uniform
splits allocate nothing. Results and masks are unchanged.
This is a simplification, not a measured speedup. The full `bench-sql`
suite (TPC-H SF=1 and SF=10, TPC-DS, ClickBench, ClickBench Sorted,
FineWeb, PolarSignals) returned "No clear signal" on every benchmark,
scattered between -2.8% and +3.3% around zero. TPC-H SF=10 is the most
trustworthy of those - its Parquet control spans only 0.96-1.03 - and it
came back at -0.3%. Whatever is saved per split is too small a share of
end-to-end query time to measure; the argument for the change is that the
common path no longer allocates.
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
0 commit comments