-
Notifications
You must be signed in to change notification settings - Fork 90
Parallelize pg_restore operations #561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks!
I think a good default value for --restore-jobs
should be the current value for --index-jobs
(dynamic, from command line or environment) , because this impacts the target server only.
Also I'm not sure we need --single-transaction
on the target server at all, actually, but I think I like the way to chose to still have it when --restore-jobs
is 1.
f74b973
to
f347558
Compare
Agreed. This was not a trivial change as some
I think we should keep a workaround for users that desire to keep the old behavior where we always used |
d38d114
to
bb99942
Compare
This commit adds a new option --restore-jobs to pgcopydb that allows specifying how many jobs can be used to run pg_restore operations in parallel. This option can also be set using the PGCOPYDB_RESTORE_JOBS environment variable. When this option is set to 1, pgcopydb will run pg_restore with the --single-transaction option, and pgcopydb will behave the same as it used to. Otherwise, pg_restore will be run with the --jobs option set to the number of jobs specified by the user. If the user does not supply the --restore-jobs option, or set the environment variable, pgcopydb will use the index-jobs value as default.
b142fef
to
7ace7db
Compare
This commit adds a new option --restore-jobs to pgcopydb that allows specifying how many jobs can be used to run pg_restore operations in parallel. This option can also be set using the PGCOPYDB_RESTORE_JOBS environment variable.
When this option is set to 1, pgcopydb will run pg_restore with the --single-transaction option, and pgcopydb will behave the same as it used to. Otherwise, pg_restore will be run with the --jobs option set to the number of jobs specified by the user.
If the user does not supply the --restore-jobs option, or set the environment variable, pgcopydb will use the index-jobs value as default.
Fixes: #539