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 E7EB7D1D35F for ; Sat, 1 May 2004 08:18:23 -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 61763-06 for ; Sat, 1 May 2004 08:18:05 -0300 (ADT) Received: from mailhost2.tudelft.nl (mailhost2.tudelft.nl [130.161.180.2]) by svr1.postgresql.org (Postfix) with ESMTP id 688BBD1DB23 for ; Sat, 1 May 2004 08:18:02 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by rav.antivirus (Postfix) with ESMTP id 184CC186DC; Sat, 1 May 2004 13:18:05 +0200 (MEST) Received: from listserv.tudelft.nl (listserv.tudelft.nl [130.161.180.33]) by mailhost2.tudelft.nl (Postfix) with ESMTP id EA9C1186CD; Sat, 1 May 2004 13:18:04 +0200 (MEST) Received: from oli.tudelft.nl (jochemd.tnw-s.tudelft.nl [145.94.90.156]) by listserv.tudelft.nl (8.12.10/8.12.8) with ESMTP id i41BI4F7007684; Sat, 1 May 2004 13:18:04 +0200 (MEST) Message-ID: <4093876C.2060409@oli.tudelft.nl> Date: Sat, 01 May 2004 13:18:04 +0200 From: Jochem van Dieten Organization: OnLine Internet User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: Manfred Koizar , pgsql-performance@postgresql.org Subject: Re: planner/optimizer question References: <409290F0.10509@oli.tudelft.nl> <8881.1083374379@sss.pgh.pa.us> In-Reply-To: <8881.1083374379@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at tudelft.nl 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/3 X-Sequence-Number: 6834 Tom Lane wrote: > Manfred Koizar writes: >> >> Yes, the visible-to-all flag would be set as a by-product of an index >> scan, if the heap tuple is found to be visible to all active >> transactions. This update is non-critical > > Oh really? I think you need to think harder about the transition > conditions. > > Dead-to-all is reasonably safe to treat as a hint bit because *it does > not ever need to be undone*. Visible-to-all does not have that > property. Yes, really :-) When a tuple is inserted the visible-to-all flag is set to false. The effect of this is that every index scan that finds this tuple has to visit the heap to verify visibility. If it turns out the tuple is not only visible to the current transaction, but to all current transactions, the visible-to-all flag can be set to true. This is non-critical, because if it is set to false scans will not miss the tuple, they will just visit the heap to verify visibility. 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, and the I/O and (dead)lock costs of unsetting the visible-to-all flag are unknown and might be big enough to ofset any advantage on the selects. But I believe that for applications with a "load, select, drop" usage pattern (warehouses, archives etc.) having this visible-to-all flag would be a clear winner. Jochem -- I don't get it immigrants don't work and steal our jobs - Loesje