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 stho...@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