Postgres: How to find where database size growth is coming from
0
votes
2
answers
5851
views
We have a PostgreSQL database that has grown significantly in size recently, from about 340GB to 571GB over the past couple of months, and we are not tracking any significant change in user behavior over that time. Our primary DBA has made a couple of recommendations, with his chief recommendation being to export the entire database and then re-import it, which from his tests on a second server cloned from our primary requires about 3 hours of downtime, and gets the size down to only 300GB.
My two main areas of concern would be finding out where this significant growth is coming from (using du -h I can at least see it's in the /data directory with no significant growth in tablespace or pg_wal), and understanding just how importing and exporting the database can get us almost 300GB of space recovery without actually losing any production data.
Asked by awestover89
(101 rep)
Jul 5, 2022, 12:47 PM
Last activity: Jul 22, 2025, 03:58 PM
Last activity: Jul 22, 2025, 03:58 PM