Why is RDS slow after a restore from a snapshot?
By the Keel team · Last checked · 6 min read
Short answer
Because a restored RDS database is usable before all its data is on the volume. RDS loads blocks from S3 in the background, a process called lazy loading, and the first read of each block waits on that fetch. AWS's PostgreSQL test saw affected queries run 10x to 15x slower. Warm the tables you need, and count that time in your recovery time.
10x to 15x slower
How much slower affected queries ran on a non-prewarmed restored instance, in one AWS test on RDS for PostgreSQL
Source: AWS Database Blog, 14 Oct 2026
About 5 hours vs over 24
Time to full hydration with and without prewarming in that test (the non-prewarmed figure was estimated)
Source: AWS Database Blog, 14 Oct 2026
Why is RDS slow after a restore from a snapshot?
A restored instance is usable before its data has fully arrived, so the first read of each block waits on a fetch from S3.
Because the restore finishes before the data has fully arrived. AWS's documentation says you can use the restored instance as soon as its status is available, but that it keeps loading data in the background, which it calls lazy loading. If a query touches data that has not been loaded yet, the instance downloads that data from Amazon S3 at that moment, then carries on loading the rest.
So the first read of each block pays an extra trip to S3, and later reads do not. That is why the same query can be slow at 09:05 and fine at 14:00, and why one query is slow while another is not: it depends on which blocks have been touched.
It is a restore effect, not a sign of a broken database. The cure is mostly time, or doing the reading yourself on purpose, as below.
How slow does it get, and for how long?
AWS's own PostgreSQL test saw affected queries run 10x to 15x slower, and says the window typically lasts hours.
AWS does not publish one figure for every database, so treat any number as an example. In its own test on RDS for PostgreSQL, a 1,200 GiB database on gp3 storage, queries on an instance left to load on its own ran 10x to 15x slower than on one that had been warmed up first. AWS says the window typically lasts hours, depending on storage type.
| Prewarmed | Not prewarmed | |
|---|---|---|
| Time to full hydration | About 5 hours | Over 24 hours (estimated); 23% done after 5 hours |
| Large table scan | 44 seconds | 571 seconds |
| Complex join | 123 seconds | 1,531 seconds |
| Read latency | 2 to 3 ms | Up to 40 ms |
AWS says these results come from one test setup and will vary with your environment, Region and workload. Your database is likely smaller, so do not expect the same hours. Do expect the same shape: slow first, faster later.
Which restores are affected?
Point-in-time restores, new read replicas, Single-AZ to Multi-AZ conversion and Blue/Green deployments lazy load too, not only snapshot restores.
More than snapshot restores. The same AWS blog says lazy loading also applies to point-in-time recovery, new read replicas, Single-AZ to Multi-AZ conversion and Blue/Green deployments. AWS also announced in August 2026 that RDS now shows storage initialisation status for volumes created from snapshots during point-in-time restore, read replica creation and Single-AZ to Multi-AZ conversion.
Restoring into a different storage type from the source snapshot is slower still, according to the RDS documentation, because of the extra work of migrating the data. If you are tempted to change storage type during an emergency restore, remember that.
That means point-in-time recovery feels the same way: the instance appears, then warms. Plan for it there too.
Does an EBS snapshot affect performance, and can fast snapshot restore help?
AWS says fast snapshot restore is not available for RDS managed EBS volumes, so you warm the data yourself.
For RDS, the part that matters is the restore, not the snapshot. Behind the scenes RDS storage is Amazon EBS, and the AWS blog describes the volume hydrating in the background and pulling not-yet-copied blocks on first access. That is the slowness you see.
Fast snapshot restore is the EBS feature some people reach for. The AWS blog says it is not available for RDS managed EBS volumes, because RDS manages the volumes and does not expose those controls to you. That is why AWS describes warming the data yourself.
I have not found an AWS statement of how an ordinary snapshot being taken affects a running database's performance, so this post does not cover that. Test it on your own instance if it worries you.
How do you warm up a restored database?
Read the data you need soon on purpose, with pg_prewarm on PostgreSQL or full table scans, before users arrive.
Read the data you need soon, deliberately, before users do. AWS's restore documentation suggests operations that scan whole tables, such as SELECT *, so RDS downloads all of that table's backed-up data from S3. For RDS for PostgreSQL, the AWS blog ranks the options.
pg_prewarminprefetchmode is the most effective option the blog describes. Warm the table, its indexes, its TOAST table and the TOAST index.- Full scans such as
SELECT *orCOUNT(*)hydrate table data at medium speed, but not indexes, and only partly the TOAST data. pg_dumphydrates all table data in one operation, but not indexes.VACUUM ANALYZEis worth running for fresh planner statistics, but the blog says it is not reliable for hydration.
An example to adapt, not to paste blindly: this generates one pg_prewarm call per table, index, TOAST table and materialised view. Check that your PostgreSQL version supports prefetch and test it on a scratch copy first.
CREATE EXTENSION IF NOT EXISTS pg_prewarm;
SELECT format('SELECT pg_prewarm(%L, %L, %L);', c.oid::regclass, 'prefetch', 'main')
FROM pg_class c
JOIN pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind IN ('r', 'i', 't', 'm')
AND n.nspname NOT IN ('pg_catalog', 'information_schema')
\gexecExpect read latency to rise while you warm, because you are paying the cost up front. Do it before traffic arrives, or before the app is switched over. For other engines, check that engine's RDS documentation for its own approach.
How do you tell when it has finished?
Poll StorageOperationStatus and StorageOperationPercentProgress, which disappear when initialisation is complete.
Ask RDS. While storage is initialising, StorageOperationStatus shows Initializing and StorageOperationPercentProgress shows how far along it is. Both fields disappear when initialisation is complete, and the same progress shows in the RDS console.
aws rds describe-db-instances \
--db-instance-identifier my-restored-db \
--query 'DBInstances[0].[DBInstanceStatus,StorageOperationStatus,StorageOperationPercentProgress]'Do not treat available as done. In a runbook, make the cutover step wait for these fields to clear, or for your own warm-up queries to run at a normal speed, whichever you decide is the test.
What does this do to your real recovery time, and how do you plan for it?
It lengthens it, so time restore to available and available to normal speed separately in every restore test.
It lengthens it. Your recovery time is not the minutes until the instance says available; it is the time until the app is usable at a normal speed. How long an RDS restore takes covers the restore itself, and this is the second half that people forget to measure.
Put both numbers in your targets from RPO and RTO for a small SaaS. In your restore test, time three things separately: restore to available, available to initialisation finished, and the time a typical slow query takes before and after. Testing an RDS restore step by step shows the routine, and how often to test database restores suggests how often to repeat it.
- Restore the latest snapshot to a scratch instance and note the time it becomes available.
- Run your three or four slowest real queries and record the times.
- Warm the tables, indexes and TOAST data, and note how long it took.
- Run the same queries again and compare.
- Write both durations, and the gap, into your recovery plan.
AWS's own advice for production disaster recovery is to consider faster storage types, warm the critical tables and watch the progress field until it reaches 100 percent.
Does your recovery time include the slow start?
Tick each item that is true today.
- Your recovery target counts the time to normal speed, not only to available.
- You have restored to a scratch instance and run real queries on it before warming.
- You know which tables and indexes need to be warm for the app to feel normal.
- Your runbook waits for the initialisation fields to clear before cutover.
- You have recorded the warm-up duration from a real test in the last quarter.
Decision point: Five ticks: your recovery time is a measured number. Two or fewer: your plan stops at available, and users will notice the rest.
Sources
Keep reading
Keel is an AWS release and recovery operations service for SaaS teams of 3 to 15 developers, provided by Bargainn Services Ltd, a UK company registered at Companies House (16497746). Registered office: 3rd Floor, 86-90 Paul Street, London, EC2A 4NE, United Kingdom.