PostgreSQL: improving pg_dump, pg_restore performance

后端 未结 6 2179
眼角桃花
眼角桃花 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:21

    Improve pg dump&restore

    PG_DUMP | always use format-directory and -j options

    time pg_dump -j 8 -Fd -f /tmp/newout.dir fsdcm_external
    

    PG_RESTORE | always use tuning for postgres.conf and format-directory and -j options

    work_mem = 32MB
    shared_buffers = 4GB
    maintenance_work_mem = 2GB
    full_page_writes = off
    autovacuum = off
    wal_buffers = -1
    
    time pg_restore -j 8 --format=d -C -d postgres /tmp/newout.dir/
    

提交回复
热议问题