X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id A86719FB2EF for ; Wed, 9 Aug 2006 21:40:09 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 23037-06 for ; Wed, 9 Aug 2006 21:40:01 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.172]) by postgresql.org (Postfix) with ESMTP id 244EF9FB295 for ; Wed, 9 Aug 2006 21:40:00 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id m3so307145ugc for ; Wed, 09 Aug 2006 17:39:59 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=o8n4TgD6ZInICZanyFXcqcCuCpbbMtZvjPctfjUrEwQ6GMD1osb3WhnEo7hR6camE1hwRdcUCjXqv97o8WEv8IB0MKGxJYj8gCjDH1PgLUpnRb3jbgE7iw4OqAM4Vh7A+eUxW8QC3q25WaQHSIJ9JsK9V39PHkhBCGx+PXU3WZE= Received: by 10.66.240.12 with SMTP id n12mr1779028ugh; Wed, 09 Aug 2006 17:39:58 -0700 (PDT) Received: by 10.66.234.17 with HTTP; Wed, 9 Aug 2006 17:39:58 -0700 (PDT) Message-ID: <1c66bda80608091739i19ea4610jef563e394d419b08@mail.gmail.com> Date: Thu, 10 Aug 2006 12:39:58 +1200 From: adey To: "Sharma,G.S." Subject: Re: How to know the sizes of all tables & indexes in a database Cc: pgsql-admin@postgresql.org In-Reply-To: <020e01c6bb00$8e385b50$be05a8c0@ng3024> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_59408_25957327.1155170398472" References: <020e01c6bb00$8e385b50$be05a8c0@ng3024> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.573 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, HTML_30_40, HTML_MESSAGE, SPF_PASS X-Spam-Level: X-Archive-Number: 200608/122 X-Sequence-Number: 22665 ------=_Part_59408_25957327.1155170398472 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 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. 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. > ------=_Part_59408_25957327.1155170398472 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Try:-
 
SELECT relname, relpages, CAST(reltuples AS numeric) ,
 ( (rel= pages*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).

&= nbsp;
On 8/9/06, S= harma;G.S. <ghanshyam@newg= en.co.in> wrote:
Hi,
Postgres 7.3
Is there any way to know the size take= n up by each table and indexes in postgres .
I am having a 53 GB database which con= tains tables , indexes, functions etc , how i can distribute these 53 GB's = in database objects .
 
Thanks in advance
D= isclaimer :- This e-mail message including any attachment may contain confi= dential, proprietary or legally privileged information. It should not be us= ed by who is not the original intended recipient. If you have erroneously r= eceived this message, you are notified that you are strictly prohibited fro= m using, copying, altering or disclosing the content of this message. Pleas= e 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 i= ncluding damage from virus and further acknowledges that any views expresse= d 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 expres= sly with due authority of Newgen Software Technologies Ltd and / or its sub= sidiary Companies, as applicable.=20

------=_Part_59408_25957327.1155170398472--