Re: Question about explain of index scan

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Question about explain of index scan
Дата
Msg-id 9021.1125872511@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Question about explain of index scan  (Hannu Krosing <hannu@skype.net>)
Ответы Re: Question about explain of index scan  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Re: Question about explain of index scan  (Hannu Krosing <hannu@skype.net>)
Список pgsql-hackers
Hannu Krosing <hannu@skype.net> writes:
> On R, 2005-09-02 at 11:03 -0400, Tom Lane wrote:
>> I once started to make a btree opclass for XID, and stopped when it
>> occurred to me that XID comparison doesn't obey the transitive law.
>> btree won't like that...

> Does this mean that Slony's usage of btree index on XID gives
> (occasionally) wrong results ?

I seem to recall some discussion of that in the archives (but can't find
it right now).  If they do actually make btree indexes on XIDs then they
are probably broken.

XID comparison works OK as long as you make sure that all the XIDs
extant in the system at any one time are within +/- 2 billion of each
other, and so transitivity does hold within that subset.  The problem
with a btree is that upper-level tree nodes are likely to contain page
boundary keys copied from data that vanished some time ago from the
underlying table.  VACUUM-like techniques can guarantee that the
underlying table is free of old XIDs before the wraparound horizon is
reached, but I don't know how much extra safety margin is needed to
guarantee no inconsistencies inside a btree index (if indeed any such
guarantee is possible at all).
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Proof of concept COLLATE support with patch
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Question about explain of index scan