Re: idea: global temp tables

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: idea: global temp tables
Date: 2009-04-28 03:44:01
Message-ID: 162867790904272044i9396e92m3a0dad047ebaec36@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2009/4/27 Andrew Dunstan <andrew(at)dunslane(dot)net>:
>
>
> Kevin Grittner wrote:
>>
>> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
>>>
>>> I am thinking about global temp tables.
>>>
>>
>>  These would have some value to us.
>>  In case anyone doesn't know, this is a feature in the SQL standard. You
>> have a permanent definition of the schema, but the table is
>> materialized as a temporary table on reference by any connection.
>>  I can't speak to the practicality of the proposed implementation
>> techniques.
>>
>>
>
> Using a global table to achieve schema-persistent temp tables seems like a
> horrid hack - what would you do if the table used a type other than a
> standard built-in type?

Where is a problem? - there is normal dependency between types and
relation. Of course, ALTER TABLE have to be little bit different - a)
should be done, when no table is used, b) should be done only on all
temporary tables. But this technique do minimal changes in pg internal
structure. The core of problem is structure of pg_class table, that
contains possibly shared and not shared fields between global tables.
So implementation needs a) significant change of pg_class table OR b)
using some transparent table overloading

One year ago I though about some memory tables for it. But it is too
different and now, when VACUUM should be effective I thing, it is
needless.

>
> Or perhaps Pavel doesn't really mean "global" as the term is used in
> Postgres (c.f. the pg_database table)?
>

no, I though global tables in sense of SQL standard. What do you thing
are shared tables (in pg terminology)

regards
Pavel Stehule

> cheers
>
> andrew
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2009-04-28 03:47:25 Re: idea: global temp tables
Previous Message A.M. 2009-04-28 01:39:48 Re: idea: global temp tables