Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bVN3f-0003aW-BA for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Aug 2016 18:07:51 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bVN3e-0001Dy-Ua for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Aug 2016 18:07:50 +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 1bVN3e-0001Bc-0b for pgsql-hackers@postgresql.org; Thu, 04 Aug 2016 18:07:50 +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 1bVN3b-0007pQ-Cf for pgsql-hackers@postgresql.org; Thu, 04 Aug 2016 18:07:48 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1bVN3a-00013W-9W; Thu, 04 Aug 2016 14:07:46 -0400 Date: Thu, 4 Aug 2016 14:07:46 -0400 From: Bruce Momjian To: Claudio Freire Cc: Pavan Deolasee , pgsql-hackers Subject: Re: Heap WARM Tuples - Design Draft Message-ID: <20160804180746.GT1702@momjian.us> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -3.1 (---) 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 Thu, Aug 4, 2016 at 02:35:32PM -0300, Claudio Freire wrote: > > Vacuum will need to be taught not to break the invariant, but I > > believe this is viable and efficient. > > > And I didn't mention the invariant. > > The invariant would be that all WARM chains: > > * contain entire HOT chains (ie: no item pointers pointing to the > middle of a HOT chain) You mean no _index_ item pointers, right? > * start at the item pointer, and end when the t_ctid of the heap > tuple either points to another page, or a tuple with a different index > key Uh, there is only one visible tuple in a HOT chain, so I don't see the different index key as being a significant check. That is, I think we should check the visibility first, as we do now, and then, for the only-visible tuple, check the key. I don't see a value in (expensive) checking the key of an invisible tuple in hopes of stoping the HOT chain traversal. Also, what happens when a tuple chain goes off-page, then returns to the original page? That is a new HOT chain given our current code, but would the new tuple addition realize it needs to create a new index tuple? The new tuple code needs to check the index's root HOT tid for a non-match. > This is maintained by: > > * No item pointer will be created for row versions whose immediately > previous version is already on the index with the same key You really only have the ctid HOT head stored in the index, not the immediate ctid. -- 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