Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 32CF51337B61 for ; Thu, 16 Dec 2010 10:50:18 -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 71601-03 for ; Thu, 16 Dec 2010 14:50:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from spinlock.commandprompt.com (host-215.commandprompt.net [207.173.203.215]) by mail.postgresql.org (Postfix) with ESMTP id F23E11336971 for ; Thu, 16 Dec 2010 10:50:10 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by spinlock.commandprompt.com (Postfix) with ESMTP id 79331348023; Thu, 16 Dec 2010 06:50:08 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at commandprompt.com Received: from spinlock.commandprompt.com ([127.0.0.1]) by localhost (spinlock.commandprompt.com.commandprompt.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3PjQBrzDfVqk; Thu, 16 Dec 2010 06:50:05 -0800 (PST) Received: from perhan.alvh.no-ip.org (unknown [190.95.22.165]) by spinlock.commandprompt.com (Postfix) with ESMTPSA id 80852348022; Thu, 16 Dec 2010 06:50:05 -0800 (PST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 4A4296E470; Thu, 16 Dec 2010 11:50:00 -0300 (CLST) Content-Type: text/plain; charset=UTF-8 Cc: Mikael Krantz , Craig Ringer , pgsql-bugs Subject: Re: index corruption on composite primary key indexes From: Alvaro Herrera To: "Ng, Stan" In-reply-to: <6B0DF81DDD9F654C932FB34C8D7ACE627E1888@mail-001.corp.automotive.com> References: <6B0DF81DDD9F654C932FB34C8D7ACE627E1760@mail-001.corp.automotive.com> <4D076758.8060605@postnewspapers.com.au> <6B0DF81DDD9F654C932FB34C8D7ACE627E1788@mail-001.corp.automotive.com> <6B0DF81DDD9F654C932FB34C8D7ACE627E1888@mail-001.corp.automotive.com> Date: Thu, 16 Dec 2010 11:50:00 -0300 Message-Id: <1292510876-sup-5298@alvh.no-ip.org> User-Agent: Sup/git Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201012/111 X-Sequence-Number: 28917 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. They (the index pointers to dead tuples) are also cleaned up by vacuum. There's an optimization called HOT that allow them to be skipped in some cases; you may want to read http://git.postgresql.org/gitweb?p=postgresql.git;a=blob;f=src/backend/access/heap/README.HOT -- Álvaro Herrera The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support