Re: index corruption on composite primary key indexes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: index corruption on composite primary key indexes
Дата
Msg-id 21459.1292513666@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: index corruption on composite primary key indexes  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Список pgsql-bugs
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> On 16.12.2010 16:50, Alvaro Herrera wrote:
>> All tuples need to have index pointers, even the dead ones.

> To be precise, tuples that are truly dead, ie. not visible to anyone
> anymore, don't need index pointers. They usually have index pointers
> anyway, because they were needed to find the tuples before they became
> dead. But if you abort a vacuum after it has scanned the indexes, you
> end up with dead heap tuples with no index pointers. Also, there's an
> optimization in b-tree that removes index pointers to dead tuples, when
> they are encountered during index scans.

Another way you can get to that state is failure while inserting the
index entries in the first place, eg one of the indexes reports a
uniqueness failure, whereupon we abort the inserting transaction.
Now the heap tuple is present but dead, and some of the table's indexes
may have entries for it while others don't.

The correct invariant is that (a) if an index entry exists, there must
be a heap tuple for it to point at, and (b) a live tuple must have all
the index entries it should have.

            regards, tom lane

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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: index corruption on composite primary key indexes
Следующее
От: "Mariana Chigir"
Дата:
Сообщение: Urgent inquiry