Re: UPDATEDs slowing SELECTs in a fully cached database

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
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 15:47:00
Message-ID: 464.1310658420@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> writes:
> 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.

The implementation I was imagining was to define another bit in the info
parameter for XLogInsert, say XLOG_NON_TRANSACTIONAL. This could be a
high-order bit that would not go to disk. Anytime it was *not* set,
XLogInsert would set a global boolean that would remember that the
current transaction wrote a transactional WAL record. This is the
right default since the vast majority of call sites are writing records
that we would want to have flushed at commit. There are just a couple
of places that would need to be changed to add this flag to their calls.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Jeff Janes 2011-07-14 21:45:43 Re: UPDATEDs slowing SELECTs in a fully cached database
Previous Message Robert Klemme 2011-07-14 15:03:36 Re: UPDATEDs slowing SELECTs in a fully cached database