I'm using a large number of TEMP TABLES
and want to make sure I'm not leaking storage.
I create and use the table in a transaction with CREATE TEMP TABLE mytable ... ON COMMIT DROP
.
I'm having trouble understanding the documentation for CREATE TEMPORARY TABLE
. It states:
The autovacuum daemon cannot access and therefore cannot vacuum or analyze temporary tables. For this reason, appropriate vacuum and analyze operations should be performed via session SQL commands.
Will ON COMMIT DROP
reclaim space or do I need to actually run VACUUM mytable
?
If I do need to run VACUUM
then I'm not sure how, as the temp table isn't available after the transaction ends.