Sort tied start blocks cheaply and keep key searches on the index
- github
- github/openchronology/timeline-app
- commit
- main
- github/athanclark
Profiling a 10^1200 offset at a 10^-1100 step (20,000 durations, 10 s per view) showed the time in exact sorts and scans of 2,300-digit rationals: - The block is sorted by its offsets from the bound in thresholds, as float8 (monotone), with exact comparisons only to break ties. - The next-key search skips the block just grouped, which lies wholly below the new bound. - Bitmap scans are off in oc_duration_overview: PostgreSQL cannot estimate the exact filters and read a whole key range through a bitmap to find the first match an ordered index scan reaches. - anchor + threshold is computed once per group, not once per row. That view drops from 10.3 s to 2.0 s (1% window: 1.9 s to 0.6 s); other cases are unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011fFY8eruEi1xAkkMBni13B https://github.com/openchronology/timeline-app/commit/248606c7ac902cdf0309f96c4b89445bdc4e1ee0
Open Sort tied start blocks cheaply and keep key searches on the index in the timeline