From: Bruce Momjian <bruce@momjian.us>
To: Claudio Freire <klaussfreire@gmail.com>
Cc: Pavan Deolasee <pavan.deolasee@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Heap WARM Tuples - Design Draft
Date: Thu, 4 Aug 2016 14:07:46 -0400
Message-ID: <20160804180746.GT1702@momjian.us> (raw)
In-Reply-To: <CAGTBQpYsJnfyBhmvDvY9-vWex518=J4V8EfTEHvSC7MNmE=c9A@mail.gmail.com>
References: <CABOikdMop5Rb_RnS2xFdAXMZGSqcJ-P-BY2ruMd+buUkJ4iDPw@mail.gmail.com>
<CAGTBQpYpu463mQByEp5MLqcdqzOHN1qOBCDN6BRb+ehMF+b=UA@mail.gmail.com>
<CAGTBQpYsJnfyBhmvDvY9-vWex518=J4V8EfTEHvSC7MNmE=c9A@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
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 <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
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, klaussfreire@gmail.com, pavan.deolasee@gmail.com
Subject: Re: Heap WARM Tuples - Design Draft
In-Reply-To: <20160804180746.GT1702@momjian.us>
References: <CABOikdMop5Rb_RnS2xFdAXMZGSqcJ-P-BY2ruMd+buUkJ4iDPw@mail.gmail.com> <CAGTBQpYpu463mQByEp5MLqcdqzOHN1qOBCDN6BRb+ehMF+b=UA@mail.gmail.com> <CAGTBQpYsJnfyBhmvDvY9-vWex518=J4V8EfTEHvSC7MNmE=c9A@mail.gmail.com> <20160804180746.GT1702@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