-
Notifications
You must be signed in to change notification settings - Fork 54
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
Apply binary search filter expressions directly on the block metadata of Index Scan
s
#1619
Apply binary search filter expressions directly on the block metadata of Index Scan
s
#1619
Conversation
Co-authored-by: Johannes Kalmbach <[email protected]>
Co-authored-by: Johannes Kalmbach <[email protected]>
Co-authored-by: Johannes Kalmbach <[email protected]>
Co-authored-by: Johannes Kalmbach <[email protected]>
…neral implementation
Co-authored-by: Johannes Kalmbach <[email protected]>
Co-authored-by: Johannes Kalmbach <[email protected]>
…ng correct prefix in Constants.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very nice and was quite a lot of work.
Mostly missing are Tests that the Prefilter is applied in the indexScan etc.
A good way (also for manual debugging) is to add the applied prefilters to the runtimInfo()
as a detail, then they appear in the UI, and this can also be used for testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some very small nitpicks remain.
We still have to analyze, why the query planner takes so long.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a tiny misunderstanding, but this is almost ready to merge.
Conformance check passed ✅No test result changes. |
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much.
This is a great milestone for QLever!
PrefilterExpressionIndex
in IndexScan
Index Scan
s
… of `Index Scan`s (ad-freiburg#1619) With this PR, filter expressions that can be evaluated via binary search on a sorted input are directly evaluated on the block metadata of an IndexScan. For example in a query that contains `{ ?s ?p ?o FILTER (?o > 3)`} only the blocks of the full index scan (sorted by the object) are read from disk that according to their metadata might contain values `> 3`. Currently this mechanism has the following limitations: 1. It can only be applied if the IndexScan directly is the child of the FILTER clause 2. It can only be applied to logical expressions (AND/OR/NOT) and to relational expressions (greater than, equal to, etc.) between a variable and a constant. Currently the constant can not yet be an IRI or Literal.
With this PR, the prefilter expressions implemented in #1619 also apply to literals and IRIs. For example the following query only extracts the relevant, prefiltered blocks from the `IndexScan`: ``` SELECT * { ?s ?p ?o FILTER (?o >= "hallo" && ?o <= "hello") } ```
Since #1619, the size estimate for an index scan always involved one or several copies of the block metadata, which incurred a significant query planning cost for most queries. Now, such a copy is only made for an index scan followed by a `FILTER` and only the metadata of those blocks is copied, which remain after the `FILTER` (in which case the two operations are expensive anyway).
With this PR, filter expressions that can be evaluated via binary search on a sorted input are directly evaluated on the block metadata of an IndexScan. For example in a query that contains
{ ?s ?p ?o FILTER (?o > 3)
} only the blocks of the full index scan (sorted by the object) are read from disk that according to their metadata might contain values> 3
.Currently this mechanism has the following limitations: