Skip site navigation (1) Skip section navigation (2)

idea: global temp tables

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: idea: global temp tables
Date: 2009-04-27 20:44:18
Message-ID: 162867790904271344s1ec96d90j6cde295fdcc7806f@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Hello

I am thinking about global temp tables. One possible solution is
creating global temporary table like normal table and in planner stage
check using this table. When some global temporary table is detected,
then real temporary table is created and used in execution plan. It's
like:

CREATE GLOBAL TEMP TABLE foo(a varchar); -- create global empty table foo
SELECT * FROM foo;
  a) is relevant temp table for foo, use it
  a) when not, then CREATE TEMP TABLE pg_temp_1.foo(LIKE foo INCLUDING
DEFAULTS INCLUDING CONSTRAINTS INCLUDING INDEXES);
  b) transform origin query to SELECT * FROM pg_temp_1.foo;

Ideas? Notes? Objections?

regards
Pavel Stehule

Responses

pgsql-hackers by date

Next:From: Kevin GrittnerDate: 2009-04-27 21:06:36
Subject: Re: idea: global temp tables
Previous:From: Alvaro HerreraDate: 2009-04-27 18:11:00
Subject: Re: psql with "Function Type" in \df

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group