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
Improve nested loop operator #5276
Improve nested loop operator #5276
Conversation
09bdec1
to
c416dcb
Compare
2fad348
to
c16fb21
Compare
Marking as WIP - I think I have a much better approach |
5c80b06
to
0f6108d
Compare
presto-main/src/main/java/io/prestosql/operator/NestedLoopJoinOperator.java
Outdated
Show resolved
Hide resolved
e3e986f
to
b895710
Compare
presto-main/src/main/java/io/prestosql/operator/NestedLoopBuildOperator.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/NestedLoopJoinOperator.java
Show resolved
Hide resolved
@pettyjamesm which of the optimizations in this PR are valid when we assume that cross join cannot do build pruning (which it cant)? Can the PR be simplified? |
adba160
to
e5ff6ac
Compare
Good to know and thanks for the review. I've stripped out the parts that aren't necessary when we can safely assume no pruning actually happens. Should be ready for another review now. |
e5ff6ac
to
b8ac631
Compare
presto-main/src/main/java/io/prestosql/operator/NestedLoopJoinOperator.java
Show resolved
Hide resolved
b8ac631
to
07b77f6
Compare
a3f9ecf
to
bf9ac12
Compare
presto-main/src/main/java/io/prestosql/operator/NestedLoopJoinOperator.java
Outdated
Show resolved
Hide resolved
bb27cc7
to
40a966a
Compare
40a966a
to
98b4b70
Compare
presto-main/src/main/java/io/prestosql/operator/NestedLoopJoinOperator.java
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/NestedLoopJoinPagesBuilder.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/io/prestosql/operator/NestedLoopJoinPagesBuilder.java
Outdated
Show resolved
Hide resolved
Avoids varargs empty array creation per call for these usage sites
b978035
to
dd1dbfd
Compare
- Modifies NestedLoopJoinPagesBuilder to combine empty pages (aka: positionCount only pages) when the build side of the nested loop join is empty - Handles the case where either probe or build side outputs are empty and position counts are fewer by emitting the same page repeatedly, avoiding unnecessary per-iteration allocations - Reduces the amount of block array copies made in the standard case by reusing a block buffer to build each page and letting the Page constructor clone it (ie: 1/2 as many allocations) - Nullifies the output iterator as well as the probe page when finished iterating through it to make the referenced pages elligible for GC. Also nullifies more fields when the operator is closed for the same reason.
dd1dbfd
to
cd38e2c
Compare
Also adds a constructor to the
Page
class for when no blocks are passed as arguments.