Re: HOT patch - version 15

From: "Pavan Deolasee" <pavan(dot)deolasee(at)gmail(dot)com>
To: "Gregory Stark" <stark(at)enterprisedb(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Bruce Momjian" <bruce(at)momjian(dot)us>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: HOT patch - version 15
Date: 2007-09-06 03:10:12
Message-ID: 2e78013d0709052010t4d3a2c94o1f3cc5bbfa1223f3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

On 9/6/07, Gregory Stark <stark(at)enterprisedb(dot)com> wrote:
>
> "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>
> >
> > ISTM the only time we should be doing HOT cleanup work is when we are
> > trying to insert a new tuple on that page --- and maybe even only when
> > we try and it doesn't fit straight off. Otherwise you're pushing
> > maintenance work into foreground query pathways, which is exactly where
> > I don't think we should be headed.
>
> Ah, as I understand it you can't actually do the pruning then because the
> executor holds references to source tuple on the page. In other words you
> can
> never "get the vacuum lock" there because you already have the page pinned
> yourself.
>
>
I don't think executor holding a reference is a problem because when
we check for vacuum lock, we have already pinned the page anyways.
But moving the old tuple around deep down in the UPDATE code path
(when we realize that there is no free space) is an issue. I know Heikki
tried to do it this way - but then moved the pruning code to lookup
code. Heikki ?

Another real problem with doing pruning only in UPDATE path is that
we may end up with long HOT chains if the page does not receive a
UPDATE, after many consecutive HOT updates. Every lookup to the
visible tuple in this chain would be CPU expensive since it would require
long chain following.

The downside is of course that SELECT may occasionally do more work.
But since we ensure that we do the extra work only when there is no
contention on the page, ISTM that the downside is limited.

Thanks,
Pavan

--
Pavan Deolasee
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2007-09-06 04:56:21 Re: [PATCHES] Lazy xid assignment V4
Previous Message Robert Treat 2007-09-06 01:02:15 Re: [PATCHES] Lazy xid assignment V4