Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid index scan for lower/upper bounds containing NULL keys #8447

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

dyemanov
Copy link
Member

This PR is a solution for #8278.

If the retrieval is flagged to ignore NULL keys, check whether any used segment of the lower/upper lookup keys contain NULL and if so just skip the index scan returning the empty bitmap.

Stats for the test case inside #8278:

before this PR:

Current memory = 20439712
Delta memory = 50352
Max memory = 20817952
Elapsed time = 36.030 sec
Cpu = 36.020 sec
Buffers = 2048
Reads = 1787
Writes = 4
Fetches = 7560432

after this PR:

Current memory = 18979680
Delta memory = 126736
Max memory = 19058304
Elapsed time = 0.018 sec
Cpu = 0.020 sec
Buffers = 2048
Reads = 1115
Writes = 0
Fetches = 18513

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoid index lookup for a NULL key if the condition is known to always be FALSE in this case
3 participants