Conversation
tamirms
added this pull request to stack #1044
September 25, 2026 19:41
A popular term's bitmap sits whole in its index.pack bucket record, so a query that needs one or two slabs of it reads all of it: on pubnet chunk 6410 a popular page reads about 9 MB of index to answer from one to three slabs. It also makes every other term in that bucket expensive to read. When a bucket record would exceed 256 KiB, its largest terms (16 KiB or more) are demoted: the term's slot keeps only its fingerprint, and its bitmap is written again after the buckets as part records, each covering a fixed span of slabs. A directory in index.pack's app data, keyed by the blinded term, says where each demoted term's parts start. LookupKeys reads only the parts the query's window reaches and reports the range they cover, so the two-stage Matches reads a few parts for a typical page. This changes the on-disk format: the stamp moves to version 2 and index.pack's format id from 0xFE1E000D to 0xFE1E0010, so an older binary refuses the new artifacts rather than misreading them. Parts and the directory add about 0.17% to the index. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QHnF5BhsuoxpWxGmatQzmt
tamirms
force-pushed
the
tamirms/events-dense-term-parts
branch
from
September 25, 2026 20:35
69dfba4 to
a976f14
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
index.packbucket record would exceed 256 KiB, its largest terms of 16 KiB or more are demoted: the term's slot keeps only its fingerprint, and its bitmap is written again after the buckets as part records, each covering a fixed span of slabs.index.pack's app data, keyed by the blinded term, records where each demoted term's parts start.index.pack's format id from0xFE1E000Dto0xFE1E0010, so an older binary refuses the new artifacts instead of misreading them.Why
A popular term's bitmap sits whole in its bucket record, so a query that needs one or two slabs of it reads all of it. On pubnet chunk 6410 the fifteen most popular terms are 250 KiB to 1.08 MiB each, and a popular page reads about 9 MB of index to answer from one to three slabs. It also makes every other term in that bucket expensive, since a lookup reads the whole bucket record. With parts and the windowed lookup from the PR below, a page reads only the parts its slabs fall in. Parts and the directory add about 0.17% to the index.
Known limitations
tamirms/full-history-p99-campaignwill also need to write parts and the directory, to stay byte-identical with this build.🤖 Generated with Claude Code