pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: pavan95 <pavan.postgresdba@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Calculation of Database Size in postgres
Date: Wed, 14 Feb 2018 09:25:11 -0500
Message-ID: <20180214142511.GB2416@tamriel.snowman.net> (raw)
In-Reply-To: <1518610876343-0.post@n3.nabble.com>
References: <1518603470895-0.post@n3.nabble.com>
	<1518603681.2402.0.camel@cybertec.at>
	<1518603837502-0.post@n3.nabble.com>
	<1518606990.2402.2.camel@cybertec.at>
	<1518610876343-0.post@n3.nabble.com>

Greetings,

* pavan95 (pavan.postgresdba@gmail.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

Attachments:

  signature.asc (application/pgp-signature, 818B) download

view thread (6+ messages)

Message-ID: <20180214142511.GB2416@tamriel.snowman.net>
Permalink:  ../20180214142511.GB2416@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20180214142511.GB2416@tamriel.snowman.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: sfrost@snowman.net, pavan.postgresdba@gmail.com
  Subject: Re: Calculation of Database Size in postgres
  In-Reply-To: <20180214142511.GB2416@tamriel.snowman.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox