From: | Vick Khera <vivek(at)khera(dot)org> |
---|---|
To: | pgsql <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Feature proposal |
Date: | 2010-08-26 11:51:23 |
Message-ID: | AANLkTimLP2VeDEE_T0EpvMhpWqLmUfrKfx1zmpZK_kmT@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Wed, Aug 25, 2010 at 8:48 PM, Craig Ringer
<craig(at)postnewspapers(dot)com(dot)au> wrote:
> synchronous_commit also has effects on data safety. It permits the loss of
> transactions committed within the commit delay interval if the server
> crashes. If you turn it on, you need to decide how much recent work you can
> afford to lose if the database crashes. Not sure if it can be applied with a
> reload or whether it requires a full server restart.
>
I routinely set synchronous_commit = off on a per-connection or
per-transaction basis. The beauty of it is that it still honors
transaction boundaries. That is, if there is a server crash the
transaction will be either there or not as a whole; it will not be
partially applied. This works great for bulk imports and changes to
the DB for me, since I can always just re-run my programs on such
failure and everything will pick up where it left off. It takes some
planning but is worth it.
> So: if you don't know exactly what you're doing, leave fsync alone.
I agree -- leave fsync alone. You get benefit from synchronous_commit
without the corruption risk.
The other advice on boosting checkpoint segments and timeout are spot
on. Make them pretty big and it will make your import go way faster.
If you have a spare disk on which to move the checkpoint segments so
that you eliminate the seek time on them, move them to get even more
speed. After your import, you can make the number of segments smaller
again if that suits your workload.
From | Date | Subject | |
---|---|---|---|
Next Message | Arjen Nienhuis | 2010-08-26 11:56:09 | Re: How to convert a binary filed to an integer field? |
Previous Message | Merlin Moncure | 2010-08-26 11:37:18 | Re: How to convert a binary filed to an integer field? |