Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id CEEDF9FA376 for ; Tue, 31 Oct 2006 20:20:32 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 90764-03 for ; Tue, 31 Oct 2006 20:20:28 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.envysolutions.com (mark.mielke.cc [206.248.142.186]) by postgresql.org (Postfix) with ESMTP id 18B069F9F80 for ; Tue, 31 Oct 2006 20:20:28 -0400 (AST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.envysolutions.com (Postfix) with ESMTP id 414FA5403C; Tue, 31 Oct 2006 19:20:26 -0500 (EST) X-Virus-Scanned: amavisd-new at mail.envysolutions.com Received: from mail.envysolutions.com ([127.0.0.1]) by localhost (mark.mielke.cc [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zzkmz9zfNSBp; Tue, 31 Oct 2006 19:20:26 -0500 (EST) Received: by mail.envysolutions.com (Postfix, from userid 500) id 145715403E; Tue, 31 Oct 2006 19:20:26 -0500 (EST) Date: Tue, 31 Oct 2006 19:20:26 -0500 From: mark@mark.mielke.cc To: Ivan Voras Cc: pgsql-performance@postgresql.org Subject: Re: MVCC & indexes? Message-ID: <20061101002025.GA21873@mark.mielke.cc> References: <4547C65C.6090208@fer.hr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4547C65C.6090208@fer.hr> User-Agent: Mutt/1.4.2.2i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200610/641 X-Sequence-Number: 21770 On Tue, Oct 31, 2006 at 10:55:40PM +0100, Ivan Voras wrote: > Ok, so MVCC is the best thing since a guy put a round stone on a stick > and called it "the wheel", but I've seen several references on this list > about "indexes not being under MVCC" - at least that's how I read it, > the original posts were explaining why indexes can't be used for solving > MIN()/MAX()/COUNT() aggregates. Is this correct? > In particular, I'm trying to find out is there (b)locking involved when > concurrently updating and/or inserting records in an indexed table. My > guess is that, since PG does copy+delete on updating, even updating a > non-indexed field will require fixups in the index tree (to point to the > new record) and thus (b)locking. Short bits of blocking. The PostgreSQL index 'problem', is that indexes are conservative. They only guarantee to return at least as much data as you should see. They cannot be used to limit what you see to only as much as you should see. Cheers, mark -- mark@mielke.cc / markm@ncf.ca / markm@nortel.com __________________________ . . _ ._ . . .__ . . ._. .__ . . . .__ | Neighbourhood Coder |\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ | | | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, Ontario, Canada One ring to rule them all, one ring to find them, one ring to bring them all and in the darkness bind them... http://mark.mielke.cc/