Hi.

Some (maybe all) row statistics are lost after the database has recovered after a failover. So it's recommended to ANALYZE all databases in a cluster after recovery.

Amazon's AWS RDS (their managed SQL databases service) even sends an email "consider running analyze if your database is slow" after a failover of so called MultiAZ databases (with fast automatic failover for double price). Funny that they send it for both PostgreSQL and Oracle databases, which, I suppose, confuses Oracle DBA's greatly.

And in AWS RDS MultiAZ a failover is pretty common. Minor version upgrade - failover. A storage hiccup - failover. Out of memory - failover.

Shouldn't this analyze be queued and all tables analyzed automatically after failover by autovacuum daemon? With up to autovacuum_max_workers in parallel?

It might save some DBA's from a couple of lost sleeping hours for sure. What do you think? A GUC option? On by dafault? Maybe even backported, but off by default in released versions?

--
Tomasz "Tometzky" Ostrowski


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to