X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id BB76DD1EB24 for ; Sat, 1 May 2004 13:23:07 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 27122-10 for ; Sat, 1 May 2004 13:22:46 -0300 (ADT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 4B3B8D1EAC6 for ; Sat, 1 May 2004 13:22:45 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i41GLS6g014615; Sat, 1 May 2004 12:21:28 -0400 (EDT) To: Jochem van Dieten Cc: Manfred Koizar , pgsql-performance@postgresql.org Subject: Re: planner/optimizer question In-reply-to: <4093876C.2060409@oli.tudelft.nl> References: <409290F0.10509@oli.tudelft.nl> <8881.1083374379@sss.pgh.pa.us> <4093876C.2060409@oli.tudelft.nl> Comments: In-reply-to Jochem van Dieten message dated "Sat, 01 May 2004 13:18:04 +0200" Date: Sat, 01 May 2004 12:21:28 -0400 Message-ID: <14614.1083428488@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200405/5 X-Sequence-Number: 6836 Jochem van Dieten writes: > The moment the heap tuple is updated/deleted the visible-to-all > flag needs to be set to false again in all indexes. This is > critical, Exactly. This gets you out of the hint-bit semantics and into a ton of interesting problems, such as race conditions. (Process A determines that tuple X is visible-to-all, and goes to update the index tuple. Before it can reacquire lock on the index page, process B updates the heap tuple and visits the index to clear the flag bit. Once A obtains lock it will set the flag bit. Oops.) Basically what you are buying into with such a thing is multiple copies of critical state. It may be only one bit rather than several words, but updating it is no less painful than if it were a full copy of the tuple's commit status. regards, tom lane