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

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: best way to fetch next/prev record based on index
Дата
Msg-id 877jsmr90c.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: best way to fetch next/prev record based on index  ("Merlin Moncure" <merlin.moncure@rcsonline.com>)
Список pgsql-performance
"Merlin Moncure" <merlin.moncure@rcsonline.com> writes:

> Well, if and when the rowtype comparison can be made to work over multi
> part keys (and the optimizer is made to do tricks there), postgres can
> be made to give much better generalized ISAM access.  In the meantime,
> I'll just troubleshoot specific cases via application specific behavior
> as they come up.  In any case, many thanks to Greg and Tom for taking
> the time to pick this apart.

Well I'm not sure whether you caught it, but Tom did come up with a
work-around that works with the current infrastructure if all the columns
involved are the same datatype.

You can create a regular btree index on the expression array[a,b,c] and then
do your lookup using array[a,b,c] > array[a1,b1,c1].

This will only work in 7.4, not previous releases, for several reasons.

--
greg

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

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