Re: Heap WARM Tuples - Design Draft

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: Claudio Freire <klaussfreire(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Heap WARM Tuples - Design Draft
Date: 2016-08-07 14:49:45
Message-ID: 20160807144945.GA22146@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)momjian(dot)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 +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-08-07 15:52:22 Re: Consolidate 'unique array values' logic into a reusable function?
Previous Message Ilya Kosmodemiansky 2016-08-07 12:03:17 Wait events monitoring future development