pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Alvaro Herrera <alvherre@commandprompt.com>
Cc: Ng, Stan <sng@automotive.com>
Cc: Mikael Krantz <mk@zigamorph.se>
Cc: Craig Ringer <craig@postnewspapers.com.au>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: index corruption on composite primary key indexes
Date: Thu, 16 Dec 2010 16:57:53 +0200
Message-ID: <4D0A28F1.3060502@enterprisedb.com> (raw)
In-Reply-To: <1292510876-sup-5298@alvh.no-ip.org>
References: <6B0DF81DDD9F654C932FB34C8D7ACE627E1760@mail-001.corp.automotive.com>
	<4D076758.8060605@postnewspapers.com.au>
	<6B0DF81DDD9F654C932FB34C8D7ACE627E1788@mail-001.corp.automotive.com>
	<AANLkTimHLhK5Pt-52fDnc5c8fJ1D9G37=H9-YigTgvwU@mail.gmail.com>
	<6B0DF81DDD9F654C932FB34C8D7ACE627E1888@mail-001.corp.automotive.com>
	<1292510876-sup-5298@alvh.no-ip.org>

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



view thread (10+ messages)  latest in thread

Message-ID: <4D0A28F1.3060502@enterprisedb.com>
Permalink:  ../4D0A28F1.3060502@enterprisedb.com/
Also on:    postgresql.org/message-id/4D0A28F1.3060502@enterprisedb.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: heikki.linnakangas@enterprisedb.com, alvherre@commandprompt.com, sng@automotive.com, mk@zigamorph.se, craig@postnewspapers.com.au
  Subject: Re: index corruption on composite primary key indexes
  In-Reply-To: <4D0A28F1.3060502@enterprisedb.com>
  References: <6B0DF81DDD9F654C932FB34C8D7ACE627E1760@mail-001.corp.automotive.com> <4D076758.8060605@postnewspapers.com.au> <6B0DF81DDD9F654C932FB34C8D7ACE627E1788@mail-001.corp.automotive.com> <AANLkTimHLhK5Pt-52fDnc5c8fJ1D9G37=H9-YigTgvwU@mail.gmail.com> <6B0DF81DDD9F654C932FB34C8D7ACE627E1888@mail-001.corp.automotive.com> <1292510876-sup-5298@alvh.no-ip.org> <4D0A28F1.3060502@enterprisedb.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox