| The PostgreSQL 9.0 Reference Manual - Volume 1A - SQL Language Reference
by The PostgreSQL Global Development Group Paperback (6"x9"), 454 pages ISBN 9781906966041 RRP £14.95 ($19.95) Sales of this book support the PostgreSQL project! Get a printed copy>>> |
12.4.7 Disable WAL archival and streaming replication
When loading large amounts of data into an installation that uses
WAL archiving or streaming replication, it might be faster to take a
new base backup after the load has completed than to process a large
amount of incremental WAL data. To prevent incremental WAL logging
while loading, disable archiving and streaming replication, by setting
wal_level to minimal,
archive_mode to off, and
max_wal_senders to zero.
But note that changing these settings requires a server restart.
Aside from avoiding the time for the archiver or WAL sender to
process the WAL data,
doing this will actually make certain commands faster, because they
are designed not to write WAL at all if wal_level
is minimal. (They can guarantee crash safety more cheaply
by doing an fsync at the end than by writing WAL.)
This applies to the following commands:
-
CREATE TABLE AS SELECT -
CREATE INDEX(and variants such asALTER TABLE ADD PRIMARY KEY) -
ALTER TABLE SET TABLESPACE -
CLUSTER -
COPY FROM, when the target table has been created or truncated earlier in the same transaction
| ISBN 9781906966041 | The PostgreSQL 9.0 Reference Manual - Volume 1A - SQL Language Reference | See the print edition |