Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bfBrM-0003Au-2F for pgsql-hackers@arkaria.postgresql.org; Wed, 31 Aug 2016 20:11:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bfBrL-0008Hs-G6 for pgsql-hackers@arkaria.postgresql.org; Wed, 31 Aug 2016 20:11:43 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bfBrK-0008Hl-E4 for pgsql-hackers@postgresql.org; Wed, 31 Aug 2016 20:11:42 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bfBrH-0004tz-Rd for pgsql-hackers@postgresql.org; Wed, 31 Aug 2016 20:11:41 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1bfBrG-0003Mq-SI; Wed, 31 Aug 2016 16:11:38 -0400 Date: Wed, 31 Aug 2016 16:11:38 -0400 From: Bruce Momjian To: Pavan Deolasee Cc: pgsql-hackers Subject: Re: Patch: Write Amplification Reduction Method (WARM) Message-ID: <20160831201138.GD31352@momjian.us> References: <20160831200329.GC31352@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160831200329.GC31352@momjian.us> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -3.4 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On Wed, Aug 31, 2016 at 04:03:29PM -0400, Bruce Momjian wrote: > Why not just remember the tid of chains converted from WARM to HOT, then > use "amrecheck" on an index entry matching that tid to see if the index > matches one of the entries in the chain. (It will match all of them or > none of them, because they are all red.) I don't see a point in > coloring the index entries as reds as later you would have to convert to > blue in the WARM-to-HOT conversion, and a vacuum crash could lead to > inconsistencies. Consider that you can just call "amrecheck" on the few > chains that have converted from WARM to HOT. I believe this is more > crash-safe too. However, if you have converted WARM to HOT in the heap, > but crash during the index entry removal, you could potentially have > duplicates in the index later, which is bad. I think Pavan had the "crash durin the index entry removal" fixed via: > During the second heap scan, we fix WARM chain by clearing HEAP_WARM_TUPLE flag > and also reset Red flag to Blue. so the marking from WARM to HOT only happens after the index has been cleaned. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription + -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers