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 20160901194135.bxpyvyu3yqjbtyr5@alap3.anarazel.de
Whole thread Raw
In response to incomplete removal of not referenced CTEs  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
List pgsql-hackers
On 2016-09-01 21:36:13 +0200, Tomas Vondra wrote:
> Of course, it's harmless as none of those CTEs gets actually executed,
> but is this intentional, or do we want/need to fix it? I don't see
> anything about this in the docs, but it seems a bit awkward and
> confusing to remove only some of the CTEs - I think we should either
> remove all or none of them.
> 
> I don't think that should be particularly difficult - ISTM we need to
> make SS_process_ctes a bit smarter, essentially by adding a loop to
> remove the CTEs recursively (and decrease the refcount).

I don't really see a lot of benefit in expanding energy on
this. Skipping the CTE in the easy case saves som eplan cycles. Making more
effort to remove CTEs recursively probably doesn't...

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: \timing interval
Next
From: Tom Lane
Date:
Subject: Re: incomplete removal of not referenced CTEs