PostgreSQL: improving pg_dump, pg_restore performance

后端 未结 6 2208
眼角桃花
眼角桃花 2020-12-22 16:15

When I began, I used pg_dump with the default plain format. I was unenlightened.

Research revealed to me time and file size improvements with pg_

6条回答
  •  清酒与你
    2020-12-22 16:31

    Two issues/ideas:

    1. By specifying -Fc, the pg_dump output is already compressed. The compression is not maximal, so you may find some space savings by using "gzip -9", but I would wager it's not enough to warrant the extra time (and I/O) used compressing and uncompressing the -Fc version of the backup.

    2. If you are using PostgreSQL 8.4.x you can potentially speed up the restore from a -Fc backup with the new pg_restore command-line option "-j n" where n=number of parallel connections to use for the restore. This will allow pg_restore to load more than one table's data or generate more than one index at the same time.

提交回复
热议问题