From: Shaun Thomas <sthomas@optionshouse.com>
To: Craig James <cjames@emolecules.com>
To: Atri Sharma <atri.jiit@gmail.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: Fri, 21 Mar 2014 14:43:41 -0500
Message-ID: <532C966D.2080500@optionshouse.com> (raw)
In-Reply-To: <CAFwQ8rd1jY6U8qQ9EahuKFpeZrSCS1vsY9GAmb3LvAGkBB9cSQ@mail.gmail.com>
References: <CAFcOn2-9j4fTcJ39xvdCByF6dg3U_=TGumCCp1-7SH_J9G+GtA@mail.gmail.com>
<15606.1395335330@sss.pgh.pa.us>
<CAFcOn2_cv6tDwnc1w+aDz0hUiRY4Xh2ran4A14X9iApWWdU_XA@mail.gmail.com>
<CAOeZVifDg=Q6V-iAwLHr7zfUDFpGkqsKK-s108VrfbL0GaOQ9g@mail.gmail.com>
<CAFwQ8rd1jY6U8qQ9EahuKFpeZrSCS1vsY9GAmb3LvAGkBB9cSQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
On 03/21/2014 08:34 AM, Craig James wrote:
> There have been many discussions about adding hints to Postgres over the
> years. All have been firmly rejected by the Postgres developers, with
> well-argued reasons. Search the archives to learn more about this topic.
While that's true, and I agree with the sentiment, it could also be
argued that what we have now is actually worse than hints.
I've been bitten several times by wrong query plans. The cause is
usually due to bad correlation estimates or edge-cases due to incomplete
stats. Aside from cranking default_statistics_target up to 10,000, 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?
Well... they're worse, really. Hints can be deprecated, disabled in
configs, or ignored in extreme cases. Optimization fences are truly
forever. Unless of course they're removed. In which case, a bunch of
queries that exploited them will suddenly perform a whole lot worse,
causing organizations to delay upgrading PostgreSQL.
--
Shaun Thomas
OptionsHouse | 141 W. Jackson Blvd. | Suite 500 | Chicago IL, 60604
312-676-8870
sthomas@optionshouse.com
______________________________________________
See http://www.peak6.com/email_disclaimer/ for terms and conditions related to this email
--
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: sthomas@optionshouse.com, cjames@emolecules.com, atri.jiit@gmail.com, sfkeller@gmail.com, tgl@sss.pgh.pa.us
Subject: Re: Getting query plan alternatives from query planner?
In-Reply-To: <532C966D.2080500@optionshouse.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