Re: bad plan

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: bad plan
Дата
Msg-id 13634.1110312075@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: bad plan  (Gaetano Mendola <mendola@bigfoot.com>)
Ответы Re: bad plan  (Richard Huxton <dev@archonet.com>)
Re: bad plan  (Gaetano Mendola <mendola@bigfoot.com>)
Список pgsql-performance
Gaetano Mendola <mendola@bigfoot.com> writes:
>> Since your query is so simple, I'm guessing v_sc_user_request is a view.
>> Can you provide the definition?

> Of course:

I don't think you've told us the whole truth about the v_sc_packages
view.  The definition as given doesn't work at all (it'll have
duplicate column names), but more to the point, if it were that simple
then the planner would fold it into the parent query.  The subquery
scan node indicates that folding did not occur.  The most likely reason
for that is that there's an ORDER BY in the view.

Putting ORDER BYs in views that you intend to use as components of other
views is a bad practice from a performance perspective...

            regards, tom lane

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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: bad plan
Следующее
От: Josh Berkus
Дата:
Сообщение: Why would writes to pgsql_tmp bottleneck at 1mb/s?