What is pg_toast_temp_* in my DB?

Started by AI Rummanover 15 years ago3 messagesgeneral
Jump to latest
#1AI Rumman
rummandba@gmail.com

What is pg_toast_temp_* in my DB?

#2André Fernandes
andre.de.camargo.fernandes@hotmail.com
In reply to: AI Rumman (#1)
Re: What is pg_toast_temp_* in my DB?

Date: Tue, 4 Jan 2011 15:53:30 +0600
Subject: [GENERAL] What is pg_toast_temp_* in my DB?
From: rummandba@gmail.com
To: pgsql-general@postgresql.org

What is pg_toast_temp_* in my DB?

Hello!

pg_toast_temp_* are some special schemas where temporary tables are created.
Having
special schemas for temporary tables allows low-level code to recognize
such tables as temp ones, so we have many optimizations.
I believe that in the documentation there's more explanations about it.

Regards,
Andre Fernandes.

#3Adrian Klaver
adrian.klaver@aklaver.com
In reply to: André Fernandes (#2)
Re: What is pg_toast_temp_* in my DB?

On Tuesday 04 January 2011 3:04:29 am André Fernandes wrote:

Date: Tue, 4 Jan 2011 15:53:30 +0600
Subject: [GENERAL] What is pg_toast_temp_* in my DB?
From: rummandba@gmail.com
To: pgsql-general@postgresql.org

What is pg_toast_temp_* in my DB?

Hello!

pg_toast_temp_* are some special schemas where temporary tables are
created. Having
special schemas for temporary tables allows low-level code to recognize
such tables as temp ones, so we have many optimizations.
I believe that in the documentation there's more explanations about it.

Regards,
Andre Fernandes.

To get technical, temporary tables are put in pg_temp_* And per the release
notes for 8.3:

Place temporary tables' TOAST tables in special schemas named pg_toast_temp_nnn
(Tom)

This allows low-level code to recognize these tables as temporary, which enables
various optimizations such as not WAL-logging changes and using local rather
than shared buffers for access. This also fixes a bug wherein backends
unexpectedly held open file references to temporary TOAST tables.

--
Adrian Klaver
adrian.klaver@gmail.com