perf(index): add exact null-row bitmap to zone map and bloom filter#7372
Open
westonpace wants to merge 1 commit into
Open
perf(index): add exact null-row bitmap to zone map and bloom filter#7372westonpace wants to merge 1 commit into
westonpace wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
3aa6ced to
9580d80
Compare
…ndexes Captures a `RowAddrTreeMap` of every null row address during index training. IS NULL queries can now be answered in O(1) by returning `SearchResult::exact(null_rows)` instead of scanning all zones, which also eliminates the downstream recheck step. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
9580d80 to
99d03e0
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.
The queries
X IS NULLandX IS NOT NULLare very common queries. Because validity is scattered throughout a file it is not actually that easy to answer this query without scanning the column. This means very wide columns can be very slow. Very wide columns also tend to be columns that are not good candidates for btree (too much duplicated data) or bitmap (too much cardinality).On the flip side, a validity bitmap is pretty small, and maintaining one for each column is probably affordable, even for the lightweight zone map and bloom filter indexes. It would be nice to have consistent
IS NULLspeedup when a column is indexed, regardless of the index type.Captures a
RowAddrTreeMapof every null row address during index training. IS NULL queries can now be answered in O(1) by returningSearchResult::exact(null_rows)instead of scanning all zones, which also eliminates the downstream recheck step.Backward-compatible: older indexes without the
null_bitmap.lancefile load withnull_rows = Noneand fall back to the previous zone-scan path.