CommitDelay performance improvement - Mailing list pgsql-hackers

From Tom Lane
Subject CommitDelay performance improvement
Date
Msg-id 28338.982945941@sss.pgh.pa.us
Whole thread Raw
Responses Re: CommitDelay performance improvement  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: CommitDelay performance improvement  (ncm@zembu.com (Nathan Myers))
Re: CommitDelay performance improvement  (Philip Warner <pjw@rhyme.com.au>)
List pgsql-hackers
Looking at the XLOG stuff, I notice that we already have a field
(logRec) in the per-backend PROC structures that shows whether a
transaction is currently in progress with at least one change made
(ie at least one XLOG entry written).

It would be very easy to extend the existing code so that the commit
delay is not done unless there is at least one other backend with
nonzero logRec --- or, more generally, at least N other backends with
nonzero logRec.  We cannot tell if any of them are actually nearing
their commits, but this seems better than just blindly waiting.  Larger
values of N would presumably improve the odds that at least one of them
is nearing its commit.

A further refinement, still quite cheap to implement since the info is
in the PROC struct, would be to not count backends that are blocked
waiting for locks.  These guys are less likely to be ready to commit
in the next few milliseconds than the guys who are actively running;
indeed they cannot commit until someone else has committed/aborted to
release the lock they need.

Comments?  What should the threshold N be ... or do we need to make
that a tunable parameter?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: Re: [ADMIN] v7.1b4 bad performance
Next
From: Tom Lane
Date:
Subject: Re: Re: [ADMIN] v7.1b4 bad performance