Re: Feature request (or at least discussion): enable autovaccum on temp tables

From: Ivan Voras <ivoras(at)gmail(dot)com>
To: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Cc: "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Feature request (or at least discussion): enable autovaccum on temp tables
Date: 2019-05-31 16:25:38
Message-ID: CAF-QHFU+gakORnJ8KwysgYZMCBGvRoqUcxi8K_qhEFnkRZsUgA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
On Fri, 31 May 2019 at 17:43, Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
wrote:

> >>>>> "Ivan" == Ivan Voras <ivoras(at)gmail(dot)com> writes:
>
> Ivan> Since AFAIK temp tables are very close to unlogged ordinary
> Ivan> tables, what would stop this feature from being implemented?
>
> The key difference between temp tables and other tables is that temp
> table data does not use the shared_buffers but is buffered only in
> backend-local memory.
>
> This means that other processes (like, say, an autovacuum process) can
> not access the content of temp tables. So what you want is not possible.
>

Understood.

So, a related question, since we have dozens of temp tables and a lot of
code, is there a way to look up what temp tables are being created by the
current session, so I can do a VACUUM or ANALYZE on all of them in bulk? I
know I can inspect pg_temp_* schema, but how to figure out which one is
from the current session?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2019-05-31 16:26:31 Re: Inherit Database - Table Permissions
Previous Message Ivan Voras 2019-05-31 16:20:51 Re: Feature request (or at least discussion): enable autovaccum on temp tables