Re: Faster pg_resore with autovacuum off?

From: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Faster pg_resore with autovacuum off?
Date: 2024-07-28 12:47:25
Message-ID: CANzqJaBqPMHQR=DOKcUx1wdd-NcTSF55et0DvRn6LP1BO2OySw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Sun, Jul 28, 2024 at 8:40 AM Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
wrote:

> On Sat, 2024-07-27 at 14:05 -0600, Scott Ribe wrote:
> > Similar argument applies to turning off fsync, which I have found to
> sometimes make a
> > significant difference (depending on hardware).
>
> That's bad advice. Very bad advice.
> That is, unless you are ready to delete the cluster and run a new "initdb"
> after an OS crash.
>

Which I am, if there's only one database in the cluster.

>
> But why risk that, if you can get virtually the same positive effect by
> disabling
> "synchronous_commit". But all that shouldn't have a big effect on
> "pg_restore".
> To tune "pg_restore", increate "max_wal_size", "checkpoint_timeout" and
> "maintenance_work_mem".
>

I do that too.

> > The other argument I've seen, that if there's a crash during restore
> you'll have a
> > corrupted database, is bogus. What are you going to try to do with a
> database if there's
> > a crash during restore???
>
> Drop it?
> You are wrong: it is not the database that is broken after a crash, but
> the entire cluster.
>

Maybe I'm spoiled by high-quality hardware and SANs, plus VMware, but
crashes are damned rare in my environment.

I'll take that risk to restore a database faster in a *single-database
cluster*.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Ribe 2024-07-28 13:58:17 Re: Faster pg_resore with autovacuum off?
Previous Message Ron Johnson 2024-07-28 12:42:31 Re: Faster pg_resore with autovacuum off?