Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bVS6z-0007cD-6J for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Aug 2016 23:31:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bVS6y-0006P8-81 for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Aug 2016 23:31:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bVS6x-0006OW-44 for pgsql-hackers@postgresql.org; Thu, 04 Aug 2016 23:31:35 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bVS6u-0007Mk-4X for pgsql-hackers@postgresql.org; Thu, 04 Aug 2016 23:31:34 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1bVS6q-00052n-P6; Thu, 04 Aug 2016 19:31:28 -0400 Date: Thu, 4 Aug 2016 19:31:28 -0400 From: Bruce Momjian To: Pavan Deolasee Cc: Simon Riggs , Andres Freund , pgsql-hackers Subject: Re: Heap WARM Tuples - Design Draft Message-ID: <20160804233128.GC22567@momjian.us> References: <20160804163118.564ftvsck6zfgawn@alap3.anarazel.de> 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 10:58:33PM +0530, Pavan Deolasee wrote: > 2. I also think that most often the tuple that will be updated will have its > t_ctid pointing to itself. This sounds more invasive, but can we somehow Agreed! I think it has to. Great idea. > utilise the t_ctid field to store the OffsetNumber of the root line pointer? > The root line pointer only exists when the tuple under consideration has > HEAP_ONLY_TUPLE flag set and we know for such tuples, BlockNumber in t_ctid > must be same as current block (unless HEAP_UPDATED is also set and the updating > transaction eventually aborted). Oh, aborts, so the tuple we are looking at is the head of the chain and points to a tuple that was aborted. So we would still need a page-scan to handle cases where the t_ctid was over-written by an aborted tuple, but as you said it would be rare. So, if the tuple has HEAP_ONLY_TUPLE set, we know the block number ip_blkid equals our block number, so any ip_blkid value that doesn't equal our block number is a special flag that indicates that ip_posid points to the head of our HOT chain. I guess we could just set it to (our block number + 1), with rollover possible and desired. -- 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