pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Pavan Deolasee <pavan.deolasee@gmail.com>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Heap WARM Tuples - Design Draft
Date: Thu, 4 Aug 2016 19:31:28 -0400
Message-ID: <20160804233128.GC22567@momjian.us> (raw)
In-Reply-To: <CABOikdOJeK07BxR3sxDJ6x-S8=q5eQksSz-VFhZbPWhaYoewYg@mail.gmail.com>
References: <CABOikdMop5Rb_RnS2xFdAXMZGSqcJ-P-BY2ruMd+buUkJ4iDPw@mail.gmail.com>
	<20160804163118.564ftvsck6zfgawn@alap3.anarazel.de>
	<CANP8+jK30e9ZJthaCjQnTeiD+mEWpmXgZGVvLrJLgu1w3KOFSA@mail.gmail.com>
	<CABOikdOJeK07BxR3sxDJ6x-S8=q5eQksSz-VFhZbPWhaYoewYg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

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  <bruce@momjian.us>        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



view thread (75+ messages)  latest in thread

Message-ID: <20160804233128.GC22567@momjian.us>
Permalink:  ../20160804233128.GC22567@momjian.us/
Also on:    postgresql.org/message-id/20160804233128.GC22567@momjian.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: bruce@momjian.us, pavan.deolasee@gmail.com, simon@2ndquadrant.com, andres@anarazel.de
  Subject: Re: Heap WARM Tuples - Design Draft
  In-Reply-To: <20160804233128.GC22567@momjian.us>
  References: <CABOikdMop5Rb_RnS2xFdAXMZGSqcJ-P-BY2ruMd+buUkJ4iDPw@mail.gmail.com> <20160804163118.564ftvsck6zfgawn@alap3.anarazel.de> <CANP8+jK30e9ZJthaCjQnTeiD+mEWpmXgZGVvLrJLgu1w3KOFSA@mail.gmail.com> <CABOikdOJeK07BxR3sxDJ6x-S8=q5eQksSz-VFhZbPWhaYoewYg@mail.gmail.com> <20160804233128.GC22567@momjian.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox