Re: BTree tid operators and opclass

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: BTree tid operators and opclass
Дата
Msg-id 873bdenge4.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: BTree tid operators and opclass  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Greg Stark <gsstark@mit.edu> writes:
> > Here's a small patch to add the full suite of btree operators for tids and the
> > corresponding btree opclass.
>
> This has been proposed and rejected before, mainly on the basis that
> there's no conceivable application for an index on TID.  What's your
> use case?

IIRC the use case that was previously suggested was the common Oracle idiom
for removing duplicates. The Postgrse equivalent would something like:

delete from tab where exists (
  select 1 from tab as x where x.pk = tab.pk and x.ctid > tab.ctid
)


In my case I don't want to create an index on tid, I just have a list of tids
that I want to sort so I can process them in heap order.

I was going to just write a qsort comparator but this way I can use tuplesort
and not worry about what happens if it doesn't fit in memory.


--
greg

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BTree tid operators and opclass
Следующее
От: "Magnus Hagander"
Дата:
Сообщение: Win32 DEF file error