Re: Indexes slower when used in decending vs. ascending order?
В списке pgsql-novice по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Indexes slower when used in decending vs. ascending order? |
| Дата | |
| Msg-id | 9133.1144779487@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Indexes slower when used in decending vs. ascending order? (Alasdair Young <ayoung@vigilos.com>) |
| Ответы |
Re: Indexes slower when used in decending vs. ascending
|
| Список | pgsql-novice |
Alasdair Young <ayoung@vigilos.com> writes:
> I am noticing a significant speed difference between the following two
> queries (the one using "ORDER BY clientkey desc, premiseskey desc,
> logtime desc, logkey desc" takes 19 seconds to execute, versus almost
> immediate execution of the "ORDER BY clientkey, premiseskey, logtime,
> logkey") and was wondering if there was anything I could do to make
> execution any faster.
I'd bet that the problem is the "filter" on logicaldel --- is the value
of that heavily correlated with the index ordering? You could be
scanning through many many rows of the index to reach the first (last)
one with logicaldel = 'N'.
regards, tom lane
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера