Purge input relations if pruneImdtRels is set #2394
Merged
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.
This PR undoes part of a previous PR that I implemented, #2286. With this PR, when
pruneImdtRels
is set,.input
relations will be purged when they are no longer needed.In the previous PR, I changed behavior to preserve both input and output relations when the
pruneImdtRels
option was enabled. However, I think that it was the wrong decision to preserve input relations.By preserving only output relations, this maximizes the opportunity for memory savings, allowing any relation no longer needed by souffle to be purged. If a C++ program needs to access an input relation again after running the souffle program via the C++ interface, I now realize that the program should have apply both the
.input
and.output
directives, rather than relying on an.input
to be preserved. This is more consistent with other Souffle behavior; if an input relation is never used by a Souffle program, Souffle is more than happy to optimize that relation out of the program entirely.