Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 2BC291337BDB for ; Thu, 16 Dec 2010 10:58:11 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 54415-03-3 for ; Thu, 16 Dec 2010 14:58:04 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og114.obsmtp.com (exprod7og114.obsmtp.com [64.18.2.215]) by mail.postgresql.org (Postfix) with SMTP id F1E321337BC1 for ; Thu, 16 Dec 2010 10:57:57 -0400 (AST) Received: from source ([209.85.215.49]) by exprod7ob114.postini.com ([64.18.6.12]) with SMTP ID DSNKTQoo9bhjOqspJWwPAm5+3T8W1o4zW5uY@postini.com; Thu, 16 Dec 2010 06:57:59 PST Received: by mail-ew0-f49.google.com with SMTP id 20so1928831ewy.36 for ; Thu, 16 Dec 2010 06:57:57 -0800 (PST) Received: by 10.213.26.84 with SMTP id d20mr540679ebc.61.1292511477610; Thu, 16 Dec 2010 06:57:57 -0800 (PST) Received: from [192.168.1.183] (dsl-hkibrasgw2-ff7ac300-240.dhcp.inet.fi [88.195.122.240]) by mx.google.com with ESMTPS id t50sm1904800eeh.6.2010.12.16.06.57.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 16 Dec 2010 06:57:57 -0800 (PST) Message-ID: <4D0A28F1.3060502@enterprisedb.com> Date: Thu, 16 Dec 2010 16:57:53 +0200 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.1.15) Gecko/20101030 Icedove/3.0.10 MIME-Version: 1.0 To: Alvaro Herrera CC: "Ng, Stan" , Mikael Krantz , Craig Ringer , pgsql-bugs Subject: Re: index corruption on composite primary key indexes References: <6B0DF81DDD9F654C932FB34C8D7ACE627E1760@mail-001.corp.automotive.com> <4D076758.8060605@postnewspapers.com.au> <6B0DF81DDD9F654C932FB34C8D7ACE627E1788@mail-001.corp.automotive.com> <6B0DF81DDD9F654C932FB34C8D7ACE627E1888@mail-001.corp.automotive.com> <1292510876-sup-5298@alvh.no-ip.org> In-Reply-To: <1292510876-sup-5298@alvh.no-ip.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.2 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3 X-Spam-Level: X-Archive-Number: 201012/112 X-Sequence-Number: 28918 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