Re: index corruption on composite primary key indexes

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: "Ng, Stan" <sng(at)automotive(dot)com>, Mikael Krantz <mk(at)zigamorph(dot)se>, Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>, pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: index corruption on composite primary key indexes
Date: 2010-12-16 14:57:53
Message-ID: 4D0A28F1.3060502@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 16.12.2010 16:50, Alvaro Herrera wrote:
> Excerpts from Ng, Stan's message of mié dic 15 21:07:57 -0300 2010:
>
>> Now I just need to get my head wrapped around the corner cases of MVCC
>> + indexes. From a layman's perspective, it seems the index should only
>> operate on the latest version. Perhaps there's a pgsql configuration
>> option or hint on the index that I'm missing... The hunt continues!
>
> 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.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2010-12-16 15:34:26 Re: index corruption on composite primary key indexes
Previous Message Alvaro Herrera 2010-12-16 14:50:00 Re: index corruption on composite primary key indexes