Re: Implementation of global temporary tables?

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, 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 15:24:52
Message-ID: CANP8+jL_7vziq5LsR8GrGbr0PUr=0O2vHn7GB7b63ymNkNWR1w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 15 July 2015 at 15:57, Andres Freund <andres(at)anarazel(dot)de> wrote:

> On 2015-07-15 16:52:49 +0200, Andres Freund wrote:
> > 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.
>
> Hm, yes. Brainfart. Transaction table rewrites/truncations need to
> change the relfilenode.
>
> To fix We could add a backend local mapping table from global temp table
> id to the backend local relfilenode. The code to lookup the relfilenode
> is already mostly isolated.
>

It may be possible to do this, though I'm sure there's a wrinkle somewhere.
But there doesn't seem to be a need to overload the main feature request
with additional requirements. Doing that is just scope creep that prevents
us getting features out. Nice, simple patches from newer developers. Later
tuning and tweaking from more expert community members.

--
Simon Riggs http://www.2ndQuadrant.com/
<http://www.2ndquadrant.com/>
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-07-15 15:28:35 Re: Implementation of global temporary tables?
Previous Message Robert Haas 2015-07-15 15:01:48 Re: First Aggregate Funtion?