Re: incomplete removal of not referenced CTEs - Mailing list pgsql-hackers

From Andres Freund
Subject Re: incomplete removal of not referenced CTEs
Date
Msg-id 20160901195800.hkljtbsqgt3okni3@alap3.anarazel.de
Whole thread Raw
In response to Re: incomplete removal of not referenced CTEs  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: incomplete removal of not referenced CTEs  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
List pgsql-hackers
On 2016-09-01 15:46:45 -0400, Tom Lane wrote:
> Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
> > While investigating a CTE-related query, I've noticed that we don't
> > really remove all unreachable CTEs.
> 
> We expend a grand total of three lines of code on making that happen.
> I'm pretty much -1 on adding a great deal more code or complexity
> to make it happen recursively;

Agreed. And the consequences are pretty much harmless.


> the case simply doesn't arise in reasonably well written queries.

Well, it might, when the CTE reference can be removed due to some other
part of the query (e.g. plan time evaluation of immutable function).


Andres



pgsql-hackers by date:

Previous
From: Gavin Flower
Date:
Subject: Re: System load consideration before spawning parallel workers
Next
From: Simon Riggs
Date:
Subject: Re: Speedup twophase transactions