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

From Andres Freund
Subject Re: Implementation of global temporary tables?
Date
Msg-id 20150715145744.GJ5520@alap3.anarazel.de
Whole thread Raw
In response to Re: Implementation of global temporary tables?  (Andres Freund <andres@anarazel.de>)
Responses Re: Implementation of global temporary tables?  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
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.



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Implementation of global temporary tables?
Next
From: Robert Haas
Date:
Subject: Re: First Aggregate Funtion?