| От | Tom Lane |
|---|---|
| Тема | Re: Useless sort by |
| Дата | |
| Msg-id | 12103.1284389088@sss.pgh.pa.us обсуждение |
| Ответ на | Useless sort by (Gaetano Mendola <mendola@gmail.com>) |
| Ответы |
Re: Useless sort by
|
| Список | pgsql-performance |
Gaetano Mendola <mendola@gmail.com> writes:
> because of that sort in the view definition the first query above
> takes not less than 3 seconds. I have solved this performance issue
> removing the sort from the view definition and putting it in the
> select reducing the time from > 3secons to < 150ms.
> Can not the optimizer take rid of that useless sort on those
> kind of queries ?
It is not the optimizer's job to second-guess the user on whether a sort
is really needed there. If we did make it throw away non-top-level
sorts, we'd have hundreds of users screaming loudly.
regards, tom lane
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера