Re: EXISTS clauses not being optimized in the face of 'one time pass' optimizable expressions

Поиск
Список
Период
Сортировка
Искать
От
Alvaro Herrera
Тема
Re: EXISTS clauses not being optimized in the face of 'one time pass' optimizable expressions
Дата
Msg-id
20160701164505.GA304870@alvherre.pgsql
Ответ на
Список
Дерево обсуждения
EXISTS clauses not being optimized in the face of 'one time pass' optimizable expressions Merlin Moncure <mmoncure@gmail.com>
Re: EXISTS clauses not being optimized in the face of 'one time pass' optimizable expressions Robert Haas <robertmhaas@gmail.com>
Re: EXISTS clauses not being optimized in the face of 'one time pass' optimizable expressions Tom Lane <tgl@sss.pgh.pa.us>
Re: EXISTS clauses not being optimized in the face of 'one time pass' optimizable expressions Stephen Frost <sfrost@snowman.net>
Re: EXISTS clauses not being optimized in the face of 'one time pass' optimizable expressions Robert Haas <robertmhaas@gmail.com>
Re: EXISTS clauses not being optimized in the face of 'one time pass' optimizable expressions Tom Lane <tgl@sss.pgh.pa.us>
Re: EXISTS clauses not being optimized in the face of 'one time pass' optimizable expressions Robert Haas <robertmhaas@gmail.com>
Re: EXISTS clauses not being optimized in the face of 'one time pass' optimizable expressions Merlin Moncure <mmoncure@gmail.com>
Re: EXISTS clauses not being optimized in the face of 'one time pass' optimizable expressions Robert Haas <robertmhaas@gmail.com>
Re: EXISTS clauses not being optimized in the face of 'one time pass' optimizable expressions Merlin Moncure <mmoncure@gmail.com>
Re: EXISTS clauses not being optimized in the face of 'one time pass' optimizable expressions Alvaro Herrera <alvherre@2ndquadrant.com>
Re: EXISTS clauses not being optimized in the face of 'one time pass' optimizable expressions Merlin Moncure <mmoncure@gmail.com>
Re: EXISTS clauses not being optimized in the face of 'one time pass' optimizable expressions Robert Haas <robertmhaas@gmail.com>
Merlin Moncure wrote:

> It's pretty easy to craft a query where you're on the winning side,
> but what's the worst case of doing two pass...is constant folding a
> non trivial fraction of planning time?

One thing that has been suggested is to re-examine the plan after
planning is done, and if execution time is estimated to be large (FSVO),
then run a second planning pass with more expensive optimizations
enabled to try and find better plans.  The guiding principle would be to
continue to very quickly find good enough plans for
frequent/small/simple queries, but spend more planning effort on more
complex ones where execution is likely to take much longer than planning
time.

So doing constant-folding twice would be enabled for the second planning
pass.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


В списке pgsql-hackers по дате отправления
От: Vibhor Kumar
Дата:
FAQ