Re: Status report on writeable CTEs - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Status report on writeable CTEs
Date
Msg-id AANLkTimhbOC0j1TNoQaykiTs2Jy+iLQ2GSwVL4ejwzny@mail.gmail.com
Whole thread Raw
In response to Re: Status report on writeable CTEs  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-hackers
On Tue, Jul 20, 2010 at 5:13 PM, Merlin Moncure <mmoncure@gmail.com> wrote:
>>>> 2. Use temp table instead of tuplestore list. Since we agreed we need
>>>> to execute each plan one by one starting and shutting down executor,
>>>> it now looks very simple strategy.
>>>
>>> I didn't look at this because I thought using a "tuplestore receiver" in the
>>> portal logic was simple enough.  Any thoughts on how this would work?
>>
>> It's just deconstructing queries like:
>>
>> WITH t AS (INSERT INTO x ... RETURING *)
>> SELECT * FROM t;
>>
>> to
>>
>> CREATE TEMP TABLE t AS INSERT INTO x ... RETURING *;
>> SELECT * FROM t;
>
> Is it acceptable for a wCTE query to manipulate the system catalogs?
> Couldn't this cause performance issues in some cases?

Yeah, I suspect the performance wouldn't be too hot.  I think the idea
of writing into a tuplestore and then reading back out from it is the
way to go.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: antisocial things you can do in git (but not CVS)
Next
From: Robert Haas
Date:
Subject: Re: Finding slave WAL application time delay