Re: Implementation of global temporary tables?

From: Andres Freund <andres(at)anarazel(dot)de>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Zhaomo Yang <zhy001(at)cs(dot)ucsd(dot)edu>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: Implementation of global temporary tables?
Date: 2015-07-15 14:52:49
Message-ID: 20150715145249.GI5520@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2015-07-15 12:58:51 +0100, Simon Riggs wrote:
> On 14 July 2015 at 23:20, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-07-15 14:57:44 Re: Implementation of global temporary tables?
Previous Message Robert Haas 2015-07-15 14:52:29 Re: [PATCH] Generalized JSON output functions