Repository navigation
perf(processor): keep Intersect's per-tuple scratch buffers on the operator #1372
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
Merged
adsharma
merged 1 commit into
LadybugDB:main
from
zahariash:perf/intersect-probe-buffers
Oct 24, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| -DATASET CSV empty | ||
|
|
||
| -- | ||
|
|
||
| -CASE IntersectListsLongerThanOneVector | ||
| -STATEMENT CREATE NODE TABLE N(id INT64 PRIMARY KEY); | ||
| ---- ok | ||
| -STATEMENT CREATE REL TABLE E(FROM N TO N); | ||
| ---- ok | ||
| -STATEMENT UNWIND range(0, 3000) AS i CREATE (:N {id: i}); | ||
| ---- ok | ||
| # Node 0 points at the other 3000 nodes, so its list is split over two 2048-entry build tuples | ||
| # and a single probe intersects several list pairs. | ||
| -STATEMENT MATCH (h:N {id: 0}), (n:N) WHERE n.id > 0 CREATE (h)-[:E]->(n); | ||
| ---- ok | ||
| -STATEMENT MATCH (a:N), (b:N) WHERE a.id > 0 AND b.id = a.id + 1 CREATE (a)-[:E]->(b); | ||
| ---- ok | ||
| -STATEMENT MATCH (a:N), (b:N) WHERE a.id > 0 AND b.id = a.id + 2 CREATE (a)-[:E]->(b); | ||
| ---- ok | ||
| -LOG Triangle | ||
| -STATEMENT MATCH (a:N)-[e1:E]->(b:N)-[e2:E]->(c:N), (a)-[e3:E]->(c) | ||
| HINT (((a JOIN e1) JOIN b) MULTI_JOIN e2 MULTI_JOIN e3) JOIN c | ||
| RETURN COUNT(*); | ||
| ---- 1 | ||
| 8995 | ||
| -STATEMENT MATCH (a:N)-[e1:E]->(b:N)-[e2:E]->(c:N), (a)-[e3:E]->(c) | ||
| HINT (((a JOIN e1) JOIN b) MULTI_JOIN e2 MULTI_JOIN e3) JOIN c | ||
| RETURN a.id, b.id, c.id ORDER BY c.id DESC, b.id DESC LIMIT 3; | ||
| ---- 3 | ||
| 0|2999|3000 | ||
| 2998|2999|3000 | ||
| 0|2998|3000 | ||
| -LOG FourClique | ||
| -STATEMENT MATCH (a:N)-[e1:E]->(b:N)-[e2:E]->(c:N), (a)-[e3:E]->(c), (a)-[e4:E]->(d:N), (b)-[e5:E]->(d), (c)-[e6:E]->(d) | ||
| HINT (((((a JOIN e1) JOIN b) MULTI_JOIN e2 MULTI_JOIN e3) JOIN c) MULTI_JOIN e4 MULTI_JOIN e5 MULTI_JOIN e6) JOIN d | ||
| RETURN COUNT(*), SUM(a.id + b.id * 3 + c.id * 5 + d.id * 7); | ||
| ---- 1 | ||
| 2998|67489477 |
Oops, something went wrong.
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.
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.
The new code reuses one leftSelVector across intersect rounds:
The delta between the two variants of
setToUnfiltered()is subtle and easy to miss.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.
Agreed, the overload hides it. This merged before I got to it, so #1382 passes the size explicitly,
leftSelVector.setToUnfiltered(leftSelVector.getSelSize()), with a comment thattwoWayIntersectleaves the surviving left IDs at the front ofoutKeyVector. Resetting the size to the first list's length instead failsacc_hj,cyclic/single_label,cyclic/multi_labelandcyclic/large_lists.