Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Fri, May 31, 2019, 12:26 PM Ivan Voras <ivoras@xxxxxxxxx> wrote:
Hi,
On Fri, 31 May 2019 at 17:43, Andrew Gierth <andrew@xxxxxxxxxxxxxxxxxxxx> wrote:
>>>>> "Ivan" == Ivan Voras <ivoras@xxxxxxxxx> 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?


I think you might want to look at information_schema.tables; I seem to recall that view restricting itself to the tables actually visible to your connection.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux