Re: Faster pg_resore with autovacuum off? - Mailing list pgsql-admin

From Laurenz Albe
Subject Re: Faster pg_resore with autovacuum off?
Date
Msg-id e8a5593d5310ea187aaf213e7a5791127c304308.camel@cybertec.at
Whole thread Raw
In response to Re: Faster pg_resore with autovacuum off?  (Scott Ribe <scott_ribe@elevated-dev.com>)
Responses Re: Faster pg_resore with autovacuum off?
Re: Faster pg_resore with autovacuum off?
List pgsql-admin
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.

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".

> 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.

Yours,
Laurenz Albe



pgsql-admin by date:

Previous
From: Ron Johnson
Date:
Subject: Re: Stream pg_dumpall directly from CentOS7 to Red Hat server
Next
From: Ron Johnson
Date:
Subject: Re: Faster pg_resore with autovacuum off?