Skip to content
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

Add -j option to db:restore to use multiple jobs to restore databases #52

Open
petitJAM opened this issue Dec 11, 2020 · 0 comments
Open

Comments

@petitJAM
Copy link
Contributor

Like with #51, there's an option to speed up DB restores. Passing -j to pg_restore will cause it to use more than 1 process/thread for restoring a database. This is useful for large database dumps that take many minutes to restore.

From pg_restore --help:
-j, --jobs=NUM use this many parallel jobs to restore

This option could also potentially be automatically set to some number. This SO answer https://stackoverflow.com/a/6481016 has a way to check for the number of CPUs on the system. I don't know that we would want to use the max number since that might wreck the computer it's running on, but maybe half or something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant