| From: | Raj <rajeshkumar(dot)dba09(at)gmail(dot)com> |
|---|---|
| To: | Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org> |
| Subject: | Size of /pgdata |
| Date: | 2026-06-13 06:48:22 |
| Message-ID: | CAJk5Atb1v7=x-wsS-tL7Lxs7yXQy8Ng-GhXG+zzZ1gVAx=Xzjw@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-admin |
Hi all,
I am using 17.9 version.
I see suddenly du -sh /pgdata/17 shows 930GB. Total allocated is 1TB.
I checked the db size using \l+ and also pg_total_relation_size and size
for particular db is 630GB. Ignoring postgres and template dbs as they are
in KBs.
Now where the remaining 300 comes from approximately..?
I checked pg_wal and is 100gb..that is intended based on max_wal_size
setting.
Postgres logs also in MBs ..so ruling out that.
Now 300 - 100 = 200gb approximately don't know where it comes from.
So du -sh /base is approximately 830Gb whereas actual db size is 630gb as
mentioned earlier.
I took one big sample table which is 73GB, and using relfilenode(327683) I
tried finding the underlying file size du -sh 327683* and able to find the
total size the files occpuing and found 113gb.......so for one table itself
it is 40Gb additional...
I also checked the bloat of table using pgstatstuple and no bloat observed
for this sample table
Why we have so much increase of file size? How we can avoid or tune it? Is
it about reallocating files and not being used fully? What's the solution?
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Bhanu Prakash | 2026-06-13 07:09:38 | Re: Size of /pgdata |
| Previous Message | Michael Grimm | 2026-06-12 20:59:10 | Re: Howto tell pg_ctl to use a non-default directory for config files |