From: Kevin Grittner <kgrittn@ymail.com>
To: Craig James <cjames@emolecules.com>
To: Atri Sharma <atri.jiit@gmail.com>
To: Shaun Thomas <sthomas@optionshouse.com>
Cc: Stefan Keller <sfkeller@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: Getting query plan alternatives from query planner?
Date: Mon, 14 Apr 2014 07:39:17 -0700 (PDT)
Message-ID: <1397486357.89780.YahooMailBasic@web122305.mail.ne1.yahoo.com> (raw)
In-Reply-To: <532C966D.2080500@optionshouse.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
Shaun Thomas <sthomas@optionshouse.com> wrote:
> these issues tend to get solved through optimization fences.
> Reorganize a query into a CTE, or use the (gross) OFFSET 0 trick.
> How are these nothing other than unofficial hints?
Yeah, the cognitive dissonance levels get pretty high around this
issue. Some of the same people who argue strenuously against
adding hints about what plan should be chosen also argue against
having clearly equivalent queries optimize to the same plan because
they find the fact that they don't useful for coercing a decent
plan sometimes. That amounts to a hint, but obscure and
undocumented. (The OP may be wondering what this "OFFSET 0 trick"
is, and how he can use it.)
> Well... they're worse, really. Hints can be deprecated, disabled
> in configs, or ignored in extreme cases. Optimization fences are
> truly forever.
+1
With explicit, documented hints, one could search for hints of a
particular type should the optimizer improve to the point where
they are no longer needed. It is harder to do that with subtle
differences in syntax choice. Figuring out which CTEs or LIMITs
were chosen because they caused optimization barriers rather than
for their semantic merit takes some effort.
--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
--
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: kgrittn@ymail.com, cjames@emolecules.com, atri.jiit@gmail.com, sthomas@optionshouse.com, sfkeller@gmail.com, tgl@sss.pgh.pa.us
Subject: Re: Getting query plan alternatives from query planner?
In-Reply-To: <1397486357.89780.YahooMailBasic@web122305.mail.ne1.yahoo.com>
* 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