Skip to content

events: ask the index for a window, and match in two stages - #1042

Draft
tamirms wants to merge 1 commit into
tamirms/events-slab-matcherfrom
tamirms/events-windowed-matches
Draft

tamirms wants to merge 1 commit into
tamirms/events-slab-matcherfrom
tamirms/events-windowed-matches

Conversation

@tamirms

@tamirms tamirms commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

What

  • Reader.LookupKeys now takes the range of event ids the query needs (the window) and returns, alongside the bitmaps, the range its answer covers.
  • Matches asks first for the leading four slabs of the window, in the walk's direction. It asks for the rest only if the page is still not full and the first answer didn't already cover it.
  • Both readers still return whole terms and report the whole id space as covered, so every query still runs in one stage.

Why

Groundwork for the next PR, which stores a popular term's bitmap in parts. With a window, the cold reader can read only the parts a page reaches and report exactly what it read. On its own, this PR changes neither results nor I/O.

Known limitations

N/A

🤖 Generated with Claude Code

LookupKeys now takes the range of event ids the query needs and reports
the range its answer covers. Matches first asks for the leading four slabs
of the window, in the walk's direction. It asks for the rest only if the
page is still not full and the first answer did not already cover it.

Both readers still return whole terms, so they report the whole id space
and every query runs in one stage, as before. The point is the next step:
a reader that stores a large term in pieces can then read only the pieces
a page reaches.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QHnF5BhsuoxpWxGmatQzmt
@tamirms
tamirms force-pushed the tamirms/events-windowed-matches branch from 22dd8d1 to 5537210 Compare September 25, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant