I’m having to import a very large postgres database that I only have a pg_dump file for. The dump is 5.5Tb in size. I’ve seen many mentions to disable indexes and then re-index after the import to help speed up the import. If I don’t know what indexes will even exist, how can I go about disabling indexes before starting the pg_restore?
Postgres Version 15.7
OS: Ubuntu 22.04
Any other suggestions on importing such a large database?
2
Answers
Order pizza and cola, watch TV, done.
Create indexes? If needed.
If you are restoring into an empty database, then there are no indexes to start with, apart from the system tables.
pg_dump outputs the index creation commands after the copy commands, you don’t need to do anything special to make that happen.