Re: [PATCHES] Index creation takes for ever

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [PATCHES] Index creation takes for ever
Дата
Msg-id 200309071616.h87GGNa09222@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: Index creation takes for ever  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [PATCHES] Index creation takes for ever  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > I assume this completes this TODO:
> >     * Order duplicate index entries by tid for faster heap lookups
>
> I don't know why that TODO entry exists, but I think the idea is
> counterproductive.  The existing btree code will tend to put newer
> versions of a row earlier (because it puts a new entry in front of any
> with duplicate keys), which usually reduces the time spent skipping dead
> rows.  Forcing tid ordering will cost us more in dead-row skipping than
> it's likely to save elsewhere.

I assume you are talking about a unique index that probably only has a
few non-expired rows (in which case the newer rows first is better).
The TODO deals with cases where you have lots of valid duplicate index
rows, and you want to spin through all the matching rows in heap order
rather than randomly.  This is related to our CLUSTER capability.  The
idea originally came from Vadim.

At what point does this patch do the sorting?

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Index creation takes for ever
Следующее
От: Andreas Pflug
Дата:
Сообщение: Re: pg_id and pg_encoding