Re: Any better plan for this query?..

Поиск
Список
Период
Сортировка
От Matthew Wakeling
Тема Re: Any better plan for this query?..
Дата
Msg-id alpine.DEB.2.00.0905191159530.2341@aragorn.flymine.org
обсуждение исходный текст
Ответ на Re: Any better plan for this query?..  (Simon Riggs <simon@2ndQuadrant.com>)
Ответы Re: Any better plan for this query?..
Список pgsql-performance
On Tue, 19 May 2009, Simon Riggs wrote:
> Both plans for this query show an IndexScan on a two column-index, with
> an Index Condition of equality on the leading column. The ORDER BY
> specifies a sort by the second index column, so the top-level Sort is
> superfluous in this case.
>
> My understanding is that we don't currently eliminate superfluous
> additional sorts of this kind. Now I know that is a hard subject, but it
> seems straightforward to consider interesting sort order equivalence
> when we have constant equality constraints.

Yes, Postgres has been missing the boat on this one for a while. +1 on
requesting this feature.

Speaking of avoiding large sorts, I'd like to push again for partial
sorts. This is the situation where an index provides data sorted by column
"a", and the query requests data sorted by "a, b". Currently, Postgres
sorts the entire data set, whereas it need only group each set of
identical "a" and sort each by "b".

Matthew

--
 Riker: Our memory pathways have become accustomed to your sensory input.
 Data:  I understand - I'm fond of you too, Commander. And you too Counsellor

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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Any better plan for this query?..
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Any better plan for this query?..