Re: Status of Hierarchical Queries - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: Status of Hierarchical Queries
Date
Msg-id 87mz37nmx5.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: Status of Hierarchical Queries  (Gavin Sherry <swm@alcove.com.au>)
Responses Re: Status of Hierarchical Queries
List pgsql-hackers
"Gavin Sherry" <swm@alcove.com.au> writes:

> The WITH support seems okay. I guess I'd thought it might be represented
> different internally (not a sub query) but the approach Greg has taken is
> probably more straight forward (in that you get a lot of proven code for
> free). It should work fine for recursive queries too, if you just re-seed
> the param keys for every scan of the 'sub-query'.

I don't think it works for recursive queries. Since you can't have the same
executor plan in motion for two different sets of parameters simultaneously.
That's why I was talking about a Memoize node.

It is sufficient for the non-recursive case which might make it worthwhile
putting it in 8.3. But even there user's expectations are probably that the
reason they're writing it as a cte is precisely to avoid duplicate execution.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Gregory Stark
Date:
Subject: Re: autovacuum next steps, take 2
Next
From: "Joshua D. Drake"
Date:
Subject: Re: autovacuum next steps, take 2