Re: Not HOT enough

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Not HOT enough
Date: 2011-11-23 20:14:45
Message-ID: CA+U5nMLDTBRvOmc=sTnq5SHk5iu2KxbH7KAXF0H5a0RcWF+0DA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 23, 2011 at 7:57 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Wed, Nov 23, 2011 at 1:30 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> What I think might make more sense is to keep two variables,
>> RecentGlobalXmin with its current meaning and RecentDatabaseWideXmin
>> which considers only xmins of transactions in the current database.
>> Then HOT cleanup could select the appropriate cutoff depending on
>> whether it's working on a shared or non-shared relation.
>
> Unfortunately, that would have the effect of lengthening the time for
> which ProcArrayLock is held, and as benchmark results from Pavan's
> patch in that area show, that makes a very big difference to total
> throughput on write-heavy workloads.

Agreed. The performance effect of doing that would be noticeable, and
I quickly ruled out that solution without even mentioning it at
version one.

> On a related note, Simon's
> proposed change here would also complicate things for that patch,
> because databaseId would have to become part of PGXACT rather than
> PGPROC, and that would make the PGXACT act array larger

That is correct.

> and thus
> slower to scan.  I have deep respect for the perils of not doing HOT
> cleanup quickly enough, but ProcArrayLock contention is nothing to
> sneeze at either.

If you measure the difference we'll be able to see what difference
adding 4 bytes onto every pgtran makes. I think it will be small.

OTOH, the effect of database bloat is well documented and has a
seriously negative effect on performance that easily outweighs the
slight loss.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-11-23 20:15:36 Re: Not HOT enough
Previous Message Robert Haas 2011-11-23 19:57:06 Re: Not HOT enough