Re: Getting query plan alternatives from query planner?

Поиск
Список
Период
Сортировка
От Shaun Thomas
Тема Re: Getting query plan alternatives from query planner?
Дата
Msg-id 532C966D.2080500@optionshouse.com
обсуждение исходный текст
Ответ на Re: Getting query plan alternatives from query planner?  (Craig James <cjames@emolecules.com>)
Ответы Re: Getting query plan alternatives from query planner?
Список pgsql-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


В списке pgsql-performance по дате отправления:

Предыдущее
От: Claudio Freire
Дата:
Сообщение: Re: Connection pooling - Number of connections
Следующее
От: Erik van Zijst
Дата:
Сообщение: Suboptimal query plan when using expensive BCRYPT functions