Re: Calculation of Database Size in postgres

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: pavan95 <pavan(dot)postgresdba(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Calculation of Database Size in postgres
Date: 2018-02-14 14:25:11
Message-ID: 20180214142511.GB2416@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Greetings,

* pavan95 (pavan(dot)postgresdba(at)gmail(dot)com) wrote:
> Ok, In that case some data files(which in turn consists pages) might be
> partially filled.
>
> In that case the size of the database with data will be different to the
> size of the database calculated with respect to files size on disk.
>
> So how to calculate the size of only data and not the free space in the
> database?

You can look at the free space map using the pg_freespacemap extension,
or you can use the pgstattuple extension to look at free space in both
the heap and the indexes. Note that pgstattuple will scan the table,
while the freespacemap extension just looks at the FSM.

Thanks!

Stephen

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Samed YILDIRIM 2018-02-14 17:58:37 Re: filter partitions
Previous Message Stephen Frost 2018-02-14 14:21:06 Re: Disable /Suppress hostname checks while secured LDAP