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 reading and decompressing index blocks during query planning #1725

Merged

Conversation

joka921
Copy link
Member

@joka921 joka921 commented Jan 21, 2025

Avoid reading and decompressing the first and last block of an index scan during query planning (which requires only a size estimate and not the exact size). This added significant performance overhead, when only few blocks were eventually read in the index scan. Instead, we now do the following: First check whether the first and last block fully match the scan specification (this is fast). Second, if this is not the case, assume that the number of elements is a fixed fraction of total number of elements in the block (which we know from the metadata). The fixed fraction is defined by the new runtime parameter small-index-scan-size-estimate-divisor.

@sparql-conformance
Copy link

Copy link

codecov bot commented Jan 21, 2025

Codecov Report

Attention: Patch coverage is 93.87755% with 3 lines in your changes missing coverage. Please review.

Project coverage is 89.93%. Comparing base (acb6633) to head (dc689ea).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
src/index/CompressedRelation.cpp 93.47% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1725      +/-   ##
==========================================
+ Coverage   89.86%   89.93%   +0.06%     
==========================================
  Files         389      393       +4     
  Lines       37308    37611     +303     
  Branches     4204     4231      +27     
==========================================
+ Hits        33527    33824     +297     
- Misses       2485     2490       +5     
- Partials     1296     1297       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Johannes Kalmbach <[email protected]>
Copy link
Member

@hannahbast hannahbast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1-1 with Johannes, looks great, some minor improvements in clarity requested

@hannahbast hannahbast changed the title Don't read blocks from disk only for the sake of query planning. Avoid reading and decompressing index blocks during query planning Jan 23, 2025
Copy link
Member

@hannahbast hannahbast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

Signed-off-by: Johannes Kalmbach <[email protected]>
@hannahbast hannahbast merged commit b10d0b7 into ad-freiburg:master Jan 23, 2025
22 of 23 checks passed
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.

2 participants