Hi,

When working on REINDEX CONCURRENTLY I noticed that the new memory context created in the ReindexMultipleTables() seems pointless.

The purpose claimed in the code for introducing the ReindexMultipleTables context is to make sure the list we build with relation IDs survive the commit, since a commit destroys the TopTransactionContext and ReindexMultipleTables() first runs one transaction to list which tables should be reindexed and then reindexes each index in a separate transaction.

But in the first transactions where the lsit is built we actually never use TopTransactionContext, isntead PortalHeapMemory is used which is a memory context which does not go away until the REINDEX command has completed. So everything should work in the same way even if we just remove the ReindexMultipleTables memory context.

Am I missing something? Should the ReindexMultipleTables memory context be removed, or should we switch to TopTransactionContext at the begining of ReindexMultipleTables() so temporary resources used in the initial transaction can be freed?

Andreas


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to