pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: adey <adey11@gmail.com>
To: Sharma,G.S. <ghanshyam@newgen.co.in>
Cc: pgsql-admin@postgresql.org
Subject: Re: How to know the sizes of all tables & indexes in a database
Date: Thu, 10 Aug 2006 12:39:58 +1200
Message-ID: <1c66bda80608091739i19ea4610jef563e394d419b08@mail.gmail.com> (raw)
In-Reply-To: <020e01c6bb00$8e385b50$be05a8c0@ng3024>
References: <020e01c6bb00$8e385b50$be05a8c0@ng3024>

Try:-

SELECT relname, relpages, CAST(reltuples AS numeric) ,
 ( (relpages*8192)/1024 ) as MB
FROM pg_class

...which will give you space used on disk for all data pages currently in
use per table (assuming you have 8k data pages - the default).


On 8/9/06, Sharma;G.S. <ghanshyam@newgen.co.in> wrote:
>
>  Hi,
> Postgres 7.3
> Is there any way to know the size taken up by each table and indexes in
> postgres .
> I am having a 53 GB database which contains tables , indexes, functions
> etc , how i can distribute these 53 GB's in database objects .
>
> Thanks in advance
> Disclaimer :- This e-mail message including any attachment may contain
> confidential, proprietary or legally privileged information. It should not
> be used by who is not the original intended recipient. If you have
> erroneously received this message, you are notified that you are strictly
> prohibited from using, copying, altering or disclosing the content of this
> message. Please delete it immediately and notify the sender. Newgen Software
> Technologies Ltd and / or its subsidiary Companies accept no responsibility
> for loss or damage arising from the use of the information transmitted by
> this email including damage from virus and further acknowledges that any
> views expressed in this message are those of the individual sender and no
> binding nature of the message shall be implied or assumed unless the sender
> does so expressly with due authority of Newgen Software Technologies Ltd and
> / or its subsidiary Companies, as applicable.
>

view thread (2+ messages)

Message-ID: <1c66bda80608091739i19ea4610jef563e394d419b08@mail.gmail.com>
Permalink:  ../1c66bda80608091739i19ea4610jef563e394d419b08@mail.gmail.com/
Also on:    postgresql.org/message-id/1c66bda80608091739i19ea4610jef563e394d419b08@mail.gmail.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: adey11@gmail.com, ghanshyam@newgen.co.in
  Subject: Re: How to know the sizes of all tables & indexes in a database
  In-Reply-To: <1c66bda80608091739i19ea4610jef563e394d419b08@mail.gmail.com>
  References: <020e01c6bb00$8e385b50$be05a8c0@ng3024> <1c66bda80608091739i19ea4610jef563e394d419b08@mail.gmail.com>

* 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