Re: UPDATEDs slowing SELECTs in a fully cached database

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Ivan Voras" <ivoras(at)freebsd(dot)org>, <pgsql-performance(at)postgresql(dot)org>, "lars" <lhofhansl(at)yahoo(dot)com>
Subject: Re: UPDATEDs slowing SELECTs in a fully cached database
Date: 2011-07-14 14:05:41
Message-ID: 4E1EB165020000250003F2FC@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> It seems like we ought to distinguish heap cleanup activities from
> user-visible semantics (IOW, users shouldn't care if a HOT cleanup
> has to be done over after restart, so if the transaction only
> wrote such records there's no need to flush). This'd require more
> process-global state than we keep now, I'm afraid.

That makes sense, and seems like the right long-term fix. It seems
like a boolean might do it; the trick would be setting it (or not)
in all the right places.

> Another approach we could take (also nontrivial) is to prevent
> select-only queries from doing HOT cleanups. You said upthread
> that there were alleged performance benefits from aggressive
> cleanup, but IMO that can charitably be described as unproven.
> The real reason it happens is that we didn't see a simple way for
> page fetches to know soon enough whether a tuple update would be
> likely to happen later, so they just do cleanups unconditionally.

Hmm. One trivial change could be to skip it when the top level
transaction is declared to be READ ONLY. At least that would give
people a way to work around it for now. Of course, that can't be
back-patched before 9.1 because subtransactions could override READ
ONLY before that.

-Kevin

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Robert Klemme 2011-07-14 15:03:36 Re: UPDATEDs slowing SELECTs in a fully cached database
Previous Message Robert Klemme 2011-07-14 11:06:56 Re: Trigger or Function