restore-wal-skip_20100210.patch

application/octet-stream

Filename: restore-wal-skip_20100210.patch
Type: application/octet-stream
Part: 0
Message: Re: TRUNCATE+COPY optimization and --jobs=1 in pg_restore

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: context
File+
src/bin/pg_dump/pg_backup_archiver.c 7 8
diff -cprN head/src/bin/pg_dump/pg_backup_archiver.c work/src/bin/pg_dump/pg_backup_archiver.c
*** head/src/bin/pg_dump/pg_backup_archiver.c	Thu Jan 21 09:21:19 2010
--- work/src/bin/pg_dump/pg_backup_archiver.c	Wed Feb 10 13:05:26 2010
*************** restore_toc_entry(ArchiveHandle *AH, Toc
*** 540,553 ****
  						  te->tag);
  
  					/*
! 					 * In parallel restore, if we created the table earlier in
! 					 * the run then we wrap the COPY in a transaction and
! 					 * precede it with a TRUNCATE.	If archiving is not on
! 					 * this prevents WAL-logging the COPY.	This obtains a
! 					 * speedup similar to that from using single_txn mode in
! 					 * non-parallel restores.
  					 */
! 					if (is_parallel && te->created)
  					{
  						/*
  						 * Parallel restore is always talking directly to a
--- 540,552 ----
  						  te->tag);
  
  					/*
! 					 * If we created the table earlier in the run then we
! 					 * wrap the COPY in a transaction and precede it with a
! 					 * TRUNCATE. If archiving is not on this prevents WAL-
! 					 * logging the COPY. The wrap is not needed in single_txn
! 					 * mode because it has own transaction.
  					 */
! 					if (!ropt->single_txn && te->created)
  					{
  						/*
  						 * Parallel restore is always talking directly to a
*************** restore_toc_entry(ArchiveHandle *AH, Toc
*** 586,592 ****
  					AH->writingCopyData = false;
  
  					/* close out the transaction started above */
! 					if (is_parallel && te->created)
  						CommitTransaction(AH);
  
  					_enableTriggersIfNecessary(AH, te, ropt);
--- 585,591 ----
  					AH->writingCopyData = false;
  
  					/* close out the transaction started above */
! 					if (!ropt->single_txn && te->created)
  						CommitTransaction(AH);
  
  					_enableTriggersIfNecessary(AH, te, ropt);