Repository navigation
Give an error for a join that makes more tuples than 1 GiB holds - #448
Merged
Merged
Conversation
tamnd
added a commit
that referenced
this pull request
Oct 20, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
A join that makes more tuples than 1 GiB holds now gives the error
out of memory(53200). Before, the server used all the memory of the machine and stopped. The executor keeps all the tuples of a join in memory, so this limit keeps the server up until the streaming executor comes.In the regression suite, the cross join of
tenk1with itself ingroupingsetsmakes 100 million tuples. The server stopped there, and about 80 tests after it failed because they could not connect.Changes
joinand the loop ofLATERALinrupg-exec/src/scan.rsstop with an error when the join makes more tuples thanjoin_limitlets it. The limit is 1 GiB divided by the size of a tuple. The tests use 4 MiB.Known differences
PostgreSQL streams the rows of a join and gives the result. rupg gives an error for a join with more than about 27 million tuples of two relations.
Tests
A test in
rupg-execruns a cross join of 90,000 tuples, which passes, and one of 160,000 tuples, which gives 53200. fmt, clippy, the workspace tests and the checks of xtask pass on server1.