Re: incomplete removal of not referenced CTEs

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: incomplete removal of not referenced CTEs
Date: 2016-09-01 19:58:00
Message-ID: 20160901195800.hkljtbsqgt3okni3@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2016-09-01 15:46:45 -0400, Tom Lane wrote:
> Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2016-09-01 20:06:55 Re: Speedup twophase transactions
Previous Message Gavin Flower 2016-09-01 19:55:36 Re: System load consideration before spawning parallel workers