Menu

How long does a Postgres restore actually take?
📰

How long does a Postgres restore actually take?

DEV Community: postgres·SuperLede·14 days ago
#ByF4SZ2H
#devtopostgresql#devto#dev#restore#dump
Reading 0:00
15s threshold

When someone asks how long it would take to get the database back, the answer is usually a guess based on the size of the dump. I wanted a real number, so we timed it: one schema at four sizes, from a 400 MB Supabase project up to a 10 GB database with 18.8 million rows, each dump restored into an empty PostgreSQL 17 on a single 2 vCPU / 8 GB VM.

The 10 GB restore took about 12 minutes. Most of those 12 minutes went to rebuilding indexes and foreign keys. Loading the rows was the smaller part, and that changes how you should estimate your own restore.

The numbers

Plain pg_restore with one job, into a fresh PostgreSQL 17 container:

Database Rows Dump Restore

396 MiB (real Supabase Free project) 723,500 74.6 MiB 19.4 s

1.03 GiB 2,172,000 226.5 MiB 65.9 s

5.04 GiB 9,222,000 1.00 GiB 379.8 s (6.3 min)

10.05 GiB 18,822,000 1.74 GiB 725.9 s (12.1 min)

Sizes are pg_database_size of the source.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.