Re: [SQL] SQL Query Optimization

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [SQL] SQL Query Optimization
Дата
Msg-id 12955.1019147097@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [SQL] SQL Query Optimization  (Dav Coleman <dav@danger-island.com>)
Список pgsql-hackers
Dav Coleman <dav@danger-island.com> writes:
> But basically I haven't done any ANALYZE or EXPLAIN yet because of the 
> fact that the order -is- making a difference so it can't be executing
> the same query inside the database engine.

If you haven't ever done VACUUM ANALYZE then the planner is flying
completely blind as to table sizes and data distributions.  This would
(among other things) very possibly allow different plans to be estimated
as exactly the same cost --- since all the cost numbers will be based on
exactly the same default statistics.  So it's not surprising that you'd
get an arbitrary choice of plans depending on trivial details like
WHERE clause order.
        regards, tom lane


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

Предыдущее
От: Christopher Browne
Дата:
Сообщение: Re: new food for the contrib/ directory
Следующее
От: Thomas Lockhart
Дата:
Сообщение: Re: new food for the contrib/ directory