Re: Heap WARM Tuples - Design Draft - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Heap WARM Tuples - Design Draft
Date
Msg-id 20160807144945.GA22146@momjian.us
Whole thread Raw
In response to Re: Heap WARM Tuples - Design Draft  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Heap WARM Tuples - Design Draft
List pgsql-hackers
On Sat, Aug  6, 2016 at 10:51:21AM -0400, Bruce Momjian wrote:
> > If we need to find an efficient way to convert WARM chains back to HOT, which
> > will happen soon when the old index tuple retires, the system can attain a
> > stable state, not for all but many use cases.
> 
> I don't see how that is possible, except perhaps by vacuum.
> 
> OK, now I am less certain.

OK, crazy idea time --- what if we only do WARM chain additions when all
indexed values are increasing (with NULLs higher than all values)?  (If
a key is always-increasing, it can't match a previous value in the
chain.)  That avoids the problem of having to check the WARM chain,
except for the previous tuple, and the problem of pruning removing
changed rows.  It avoids having to check the index for matching key/ctid
values, and it prevents CREATE INDEX from having to index WARM chain
values.

Any decreasing value would cause a normal tuple be created.

Sure, it is a limitation, but it removes almost all of the the overhead
of WARM updates.  In fact, even the key comparisons of old/new tuples 
will return -1, 0, or 1, and from there you can know if the new key is
unchanged, or increasing.  I assume we already do this comparison to
determine if we can do a HOT update.

--  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 +



pgsql-hackers by date:

Previous
From: Ilya Kosmodemiansky
Date:
Subject: Wait events monitoring future development
Next
From: Tom Lane
Date:
Subject: Re: Consolidate 'unique array values' logic into a reusable function?