Re: PROPOSAL: Fast temporary tables - Mailing list pgsql-hackers

From Jim Nasby
Subject Re: PROPOSAL: Fast temporary tables
Date
Msg-id 56D5EAC6.5010001@BlueTreble.com
Whole thread Raw
In response to Re: PROPOSAL: Fast temporary tables  (Atri Sharma <atri.jiit@gmail.com>)
Responses Re: PROPOSAL: Fast temporary tables  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: PROPOSAL: Fast temporary tables  (Konstantin Knizhnik <k.knizhnik@postgrespro.ru>)
List pgsql-hackers
On 3/1/16 10:05 AM, Atri Sharma wrote:
> Fair point, that means inventing a whole new OID generation structure..

Generation is just the tip of the iceberg. You still need the equivalent 
to foreign keys (ie: pg_depend). While you would never have a permanent 
object depend on a temp object, the reverse certainly needs to be supported.

If I were attempting to solve this at a SQL level, I'd be thinking about 
using table inheritance such that the permanent objects are stored in a 
permanent parent. New backends would create UNLOGGED children off of 
that parent. There would be a pid column that was always NULL in the 
parent, but populated in children. That means children could use their 
own local form of an OID. When a backend terminates you'd just truncate 
all it's tables.

Actually translating that into relcache and everything else would be a 
serious amount of work.
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Commitfest Bug (was: Re: Reusing abbreviated keys during second pass of ordered [set] aggregates)
Next
From: Konstantin Knizhnik
Date:
Subject: Re: The plan for FDW-based sharding