skip to Main Content

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


    1. Restore just the schema, nothing else
    2. Remove the indexes from your fresh schema
    3. Restore just the data

    Order pizza and cola, watch TV, done.

    Create indexes? If needed.

    Login or Signup to reply.
  1. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search