Skip site navigation (1) Skip section navigation (2)

Re: idea: global temp tables

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Greg Stark" <stark(at)enterprisedb(dot)com>
Cc: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>,"Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>,"PostgreSQL Hackers" <pgsql-hackers(at)postgresql(dot)org>,"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: idea: global temp tables
Date: 2009-04-29 17:44:31
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Greg Stark <stark(at)enterprisedb(dot)com> wrote: 
> I've been thinking about Alvaro's idea of a separate smgr. If you
> had a single pg_class entry for all sessions but the smgr knew to
> store the actual data for it in a session-local file, either in a
> session-specific tablespace or using the same mechanism the
> temporary files use to direct data then the backend would basically
> never know it wasn't a regular table.
> It could still use local buffers but it could use the global
> relcache, invalidation, locks, etc. I think we would have to take a
> session-level access lock as soon as we put any data in our local
> store. And each DDL operation would have to be visited to see
> whether it needs special behaviour for locally stored tables. I
> suspect most of them will only be able to be handled if there are no
> active sessions using the table so they'll basically be no-ops
> except for the catalog changes.
Any chance that some of these improvements could be applied to temp
tables created with the PostgreSQL-specific syntax while we're at it? 
The need for several tables to be created on disk to materialize a
single temp table currently causes performance problems in some
contexts.  I don't think the updates to the system tables have the
same magnitude of performance hit as creating these tables, especially
if write barriers are on.

In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2009-04-29 17:52:10
Subject: Re: idea: global temp tables
Previous:From: Tom LaneDate: 2009-04-29 17:42:49
Subject: Re: idea: global temp tables

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group