Re: best way to fetch next/prev record based on index

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: best way to fetch next/prev record based on index
Дата
Msg-id 6EE64EF3AB31D5448D0007DD34EEB34101AEFF@Herge.rcsinc.local
обсуждение исходный текст
Ответ на best way to fetch next/prev record based on index  ("Merlin Moncure" <merlin.moncure@rcsonline.com>)
Ответы Re: best way to fetch next/prev record based on index  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-performance
Greg Stark wrote:
> > > do it for multi-column keys. It seems it would be nice if some
syntax
> > > similar to (a,b,c) > (a1,b1,c1) worked for this.
> Hum. It would seem my intuition matches the SQL92 spec and Postgres
gets
> this
> wrong.
[...]
> Even if Postgres did this right I'm not sure that would solve your
index
> woes.
> I imagine the first thing Postgres would do is rewrite it into regular
> scalar
> expressions. Ideally the optimizer should be capable of then deducing
from
> the
> scalar expressions that an index scan would be useful.

Wow.  For once, the standard is my friend.  Well, what has to be done?
:)  Does pg do it the way it does for a reason?  From the outside it
seems like the planner would have an easier job if it can make a field
by field comparison.

Would a patch introducing the correct behavior (per the standard) be
accepted?  It seems pretty complicated (not to mention the planner
issues).

Merlin



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: best way to fetch next/prev record based on index
Следующее
От: "Merlin Moncure"
Дата:
Сообщение: best way to fetch next/prev record based on index