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

From Pavel Stehule
Subject Implementation of global temporary tables?
Date
Msg-id CAFj8pRC2h6qhHsFbcE7b_7SagiS6o=5J2UvCwCb05Ka1XFv_Ng@mail.gmail.com
Whole thread Raw
Responses Re: Implementation of global temporary tables?  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: Implementation of global temporary tables?  (Atri Sharma <atri.jiit@gmail.com>)
Re: Implementation of global temporary tables?  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
Hello

Six years ago we did discuss about global temporary tables - persistent schema, ephemeral data.

http://postgresql.nabble.com/idea-global-temp-tables-td2007217.html

I am thinking so some reasons why implement this feature are valid:

* we can get some performance benefit against current temp tables - less the catalogue bloating,

* we can simplify a static validation of plpgsql functions when temp tables are used,
  more global temp tables are little bit comfortable for developers,

* we can simplify migration from some other databases, where global temp tables are default.

Some was changed from 2009:

* We have updatable CTE

* We have unlogged tables

Opened questions:

1. Name and conformance with standard of this feature - because we doesn't support modules, a mapping ANSI -> PG should not be trivial

2. Implementation

I see three possible ways how to implement it:

2.a - using on demand created temp tables - most simple solution, but doesn't help with catalogue bloating

2.b - using unlogged tables for holding statistics, relfilenode, and all necessary data

3.c - store ephemeral metadata only in memory without MVCC

Is there still interest about this feature?

Comments, notes?

Pavel

pgsql-hackers by date:

Previous
From: Kyotaro HORIGUCHI
Date:
Subject: Re: [POC] FETCH limited by bytes.
Next
From: Pavel Stehule
Date:
Subject: Re: Implementation of global temporary tables?