fix(index): use zone map index for IS NOT NULL predicates - #8088
Open
westonpace wants to merge 2 commits into
Open
fix(index): use zone map index for IS NOT NULL predicates#8088westonpace wants to merge 2 commits into
westonpace wants to merge 2 commits into
Conversation
Zone maps track exact null row addresses via a null bitmap, so IS NULL is an exact query. Allow SargableQueryParser to distinguish IS NULL exactness from range/equality exactness via a new is_null_needs_recheck field and with_exact_null_tracking() builder. Persist has_null_bitmap in ZoneMapIndexDetails proto so new_query_parser can enable this at plan time, allowing maybe_not() to succeed for IS NOT NULL on modern zone maps. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
Important This PR touches the Lance format specification. Substantive changes to the format specification — the If this is a meaningful format change:
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
We recently started tracking null bitmaps in the zone map index so we can give an exact answer to IS NULL queries.
We have a failsafe in query planning that disables
NOT <index-search>for an inexact index since the result will most likely be a small AtLeast result which will not meaningfully speed up the query and may slow it down slightly by wasting time on an index search.Unfortunately, we have to make this failsafe at planning time, so we haven't loaded the index yet, and so we don't know if a zonemap is new enough to handle exact nulls.
This PR adds a flag to the zone map details recording whether or not we have a null bitmap. We then use that at planning time to determine if we need to recheck on is null queries or not.