Re: COMMIT NOWAIT Performance Option

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Gregory Stark <stark(at)enterprisedb(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Subject: Re: COMMIT NOWAIT Performance Option
Date: 2007-02-28 19:48:10
Message-ID: 1172692090.13722.59.camel@dogma.v10.wvs
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 2007-02-28 at 14:10 -0500, Jonah H. Harris wrote:
> On 2/28/07, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> > > But if the system was shut down uncleanly as the result of a Postgres crash or
> > > fast shutdown of Postgres then that isn't an issue. And many users may prefer
> > > to bring the system up as soon as possible as long as they know any corrupt
> > > pages will be spotted and throw errors as soon as it's seen.
> >
> > I don't think we should start up a system and only detect the errors
> > later.
>
> Which is, of course, how everyone else does it. On block access, the
> checksum is verified (if you've turned checksum checking on). I
> *really* doubt you want to pull in every page in the database at
> startup time to verify the checksum or sequence. Even pages from the
> last checkpoint would be a killer.
>

Under normal operations, shutting down the database does a checkpoint,
right? So unless you're in recovery mode, there's no additional cost.
And I can't think of any reason you'd need to see any pages before the
last checkpoint (unless you don't trust your disk and just want to check
all the pages, which is more than we can do now anyway).

So the additional cost of doing CRCs every time would be the CPU cost,
and also the cost during recovery of reading in all the data pages since
the last checkpoint. That's 5 minutes of data, in the default
configuration.

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2007-02-28 19:48:45 Re: COMMIT NOWAIT Performance Option
Previous Message Jonah H. Harris 2007-02-28 19:41:42 Re: COMMIT NOWAIT Performance Option