From: Tom Lane <tgl@sss.pgh.pa.us>
To: John Lumby <johnlumby@hotmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: slow query plans caused by under-estimation of CTE cardinality
Date: Tue, 19 Feb 2013 05:09:42 -0500
Message-ID: <23125.1361268582@sss.pgh.pa.us> (raw)
In-Reply-To: <COL116-W19C19E568788169715A9A7A3F40@phx.gbl>
References: <COL116-W19C19E568788169715A9A7A3F40@phx.gbl>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
John Lumby <johnlumby@hotmail.com> writes:
> Meanwhile, I have one other suggestion aimed specifically at problematic CTEs:
> Would it be reasonable to provide a new Planner Configuration option :
> enable_nestloop_cte_inner (boolean)
> Enables or disables the query planner's use of nested-loop join plans in which a CTE is the inner.
Sounds pretty badly thought out to me. There might be some cases where
this would help, but there would be many more where it would be useless
or counterproductive.
The case that was discussed in the previous thread looked like it could
be addressed by teaching the planner to drill down into CTEs to find
variable referents, as it already does for subquery RTEs (cf
examine_simple_variable in selfuncs.c). I'm not sure if your case is
similar or not --- you didn't provide any useful amount of detail.
regards, tom lane
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, johnlumby@hotmail.com
Subject: Re: slow query plans caused by under-estimation of CTE cardinality
In-Reply-To: <23125.1361268582@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox