Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1elxzo-0005AY-9S for pgsql-admin@arkaria.postgresql.org; Wed, 14 Feb 2018 14:25:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1elxzn-0004K5-1M for pgsql-admin@arkaria.postgresql.org; Wed, 14 Feb 2018 14:25:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1elxzm-0004Jn-QP for pgsql-admin@lists.postgresql.org; Wed, 14 Feb 2018 14:25:14 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1elxzk-0007LS-72 for pgsql-admin@postgresql.org; Wed, 14 Feb 2018 14:25:14 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 6BCD35F79C; Wed, 14 Feb 2018 09:25:11 -0500 (EST) Date: Wed, 14 Feb 2018 09:25:11 -0500 From: Stephen Frost To: pavan95 Cc: pgsql-admin@postgresql.org Subject: Re: Calculation of Database Size in postgres Message-ID: <20180214142511.GB2416@tamriel.snowman.net> 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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="McJ5gjG0B0qVissu" Content-Disposition: inline In-Reply-To: <1518610876343-0.post@n3.nabble.com> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --McJ5gjG0B0qVissu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * pavan95 (pavan.postgresdba@gmail.com) wrote: > Ok, In that case some data files(which in turn consists pages) might be > partially filled.=20 >=20 > 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.=20 >=20 > 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 --McJ5gjG0B0qVissu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJahEbHAAoJEO1sijiDR2RVqJsP/0G5FbTe0ZjFY4I9u3pQN0AC NAuLP8l3yNRgWgZRe5FSq2WyvIOD8MaJFmivsw6JTmky8RR6XfQRu0SsjceSDtPN Z4wyQ/KISxZknCZxwddFkUJHww+bDmWkAy286vWdOUEEmbYltgSK6Hv6oX7i/4/c wdIlk4PkYmTu/HosPX3pmdDRhTMN+k8piHG5DnxXeSxKM7LBQtSSL8oh00f6SDpe nEdc+KRuuwbs6nPuFKdgIY0a3D1CwmtzvcEra2hPRrJKS5wew+gMqgPDgDXlNJEK M4gTvFYUkZq1+mpjVVC78r0tAtzYeKm/lCSSCTb1toXtIQZsOMOO8DX1XTi2Rcx/ 0W+96ClpY28vkTi2OfV8G2SwpNss39iIGvZN+7qrvKF1cZZ+c5v/wlunWKFqGsdm /0NOeXX0t3AvBOH60gFWfm775TkkqHtUbMloP5jkt1yObudvj6k2betHaJU5s/p3 S2gePUv4kz+Ht4+aruOW3oEPokpqav4z83YFm3j/MssedSqTi9qYu1qDCb4gA4Wv 3wnE23WXwAYW/79ip+GridK7RgjSLhmGFpW31qsKVBIA20b7jMVNmakv3+G4RmS4 tMYZLb4lFElu2eIeKV9VGly7QJcPFgqLOWnhziUnSHkmug0VgNeu9JRSaRWJ9ja0 eBRHSeW3+MQsAjQqDjRA =yP4k -----END PGP SIGNATURE----- --McJ5gjG0B0qVissu--