Repository navigation
Conversation
Dropping an LTT (committed), creating and dropping it in one transaction, or rolling back its CREATE left the relation's pages allocated in the temporary page space for the rest of the connection: the per-instance pages, the base pages created at CREATE time (pointer page + index root), the recycled page-set containers and the Cached::Relation object were never released, so the per-attachment temp file grew monotonically. Add RelationPermanent::cleanupPages() to tear down a relation's temporary pages: free the per-instance page sets and release the base index and pages via DPM_delete_relation_pages(). Route all three finalization paths through a single file-local cleanupLttInstance() helper in Savepoint.cpp that calls cleanupPages() and cleans up the Cached::Relation. The dead dfw_delete_relation deferred work in DropRelationNode::execute is removed: the commit-time relation-id lookup can never resolve a just-dropped LTT, so it never ran.
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.
Pages allocated by a
CREATE LOCAL TEMPORARY TABLEin the attachment's temporary page space are now released when the LTT is finalized — dropped and committed, cancelled out byCREATE+DROPin one transaction, or rolled back. Previously those pages (and the relation object itself) stayed allocated until the connection was closed.User-visible cases
CREATE LOCAL TEMPORARY TABLE+ rows +DROP+COMMITCREATE+DROPin the same transactionCREATE+ rows +ROLLBACKCREATE+ rows +ALTER+ROLLBACKMeasured effect
Single connection, 50 iterations of create / insert 1000 rows / drop + commit, plus the create+drop and rollback variants, watching the live temp page-space file of that attachment: