Re: Implementation of global temporary tables? - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Implementation of global temporary tables?
Date
Msg-id 20150715145249.GI5520@alap3.anarazel.de
Whole thread Raw
In response to Re: Implementation of global temporary tables?  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Implementation of global temporary tables?  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On 2015-07-15 12:58:51 +0100, Simon Riggs wrote:
> On 14 July 2015 at 23:20, Jim Nasby <Jim.Nasby@bluetreble.com> wrote:
> Pavel's original description of how to do this seem valid, and from the
> link Tom agreed in 2009.
> 
> For me the design summary is this
> 
> * CREATE GLOBAL TEMP TABLE creates catalog entries like a normal table but
> with different relkind
> * When we see a request to INSERT, DEL, UPD, SEL from the temp table, if it
> does not exist we create it as a TEMP table of the same name, using the
> Global's pg_class entry as a template

Why do we need to create that copy? We can just use the relfilenode in
all backends by having the backendid in the filename? Yes, there's a
some amount of additional code needed, but it's not that much?  I
actually think it might end up being less additional code than having a
copy, because with the copy you'll have two different oids for global
entry and the local copy.

Regards,

Andres



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [PATCH] Generalized JSON output functions
Next
From: Andres Freund
Date:
Subject: Re: Implementation of global temporary tables?