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 1B95B9FB369 for ; Thu, 21 Sep 2006 14:50:13 -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 30843-05 for ; Thu, 21 Sep 2006 14:50:00 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.236]) by postgresql.org (Postfix) with ESMTP id A26F29FB365 for ; Thu, 21 Sep 2006 14:50:00 -0300 (ADT) Received: by wx-out-0506.google.com with SMTP id t13so758354wxc for ; Thu, 21 Sep 2006 10:49: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=WD+KajUikj7ClU+6IN9zmIguggHu9sTFy2fKvLPzIX/+qQo6HBw8nuJMfjLHBGrZAJj7qqs6dQVM8BQMWD1ZzBn9dO4dTFpLzZCRGGPzUQp4lJ4P/G5zOSbOGSNUVK83MSNOr6K4lfR07Ie1LARXiS2Cn5My/agxLPid3aOQtoU= Received: by 10.70.19.16 with SMTP id 16mr25667613wxs; Thu, 21 Sep 2006 10:49:59 -0700 (PDT) Received: by 10.70.71.8 with HTTP; Thu, 21 Sep 2006 10:49:58 -0700 (PDT) Message-ID: Date: Thu, 21 Sep 2006 10:49:58 -0700 From: "Talha Khan" To: rodrigo.sakai@zanthus.com.br Subject: Re: Estimating a table size Cc: pgsql-admin@postgresql.org In-Reply-To: <001b01c6dda0$723b90d0$4700a8c0@TREEZANTHUS> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_15774_6132824.1158860998972" References: <001b01c6dda0$723b90d0$4700a8c0@TREEZANTHUS> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.966 tagged_above=0 required=5 tests=AWL, HTML_MESSAGE, SPF_PASS X-Spam-Level: X-Archive-Number: 200609/232 X-Sequence-Number: 23146 ------=_Part_15774_6132824.1158860998972 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline when you have dbsize installed you need to do select relation_size('TableName'); to get the size of the table. On 9/21/06, Rodrigo Sakai wrote: > > Hello all, > > > > I need a tool or something like it, which can give me the estimated size > of a table considering all fields, constraints, indexes, etc... > > > > For example: > > > > > > CREATE TABLE products ( > > product_id INT8, > > product_name VARCHAR(50), > > product_vendor VARCHAR(50), > > price NUMERIC(10,2), > > > > CONSTRAINT pk_products PRIMARY KEY (product_id), > > CONSTRAINT ck_price CHECK (price >= 0) > > ); > > > > > > CREATE INDEX ix_products ON products (product_name); > > > > > > See that in the example above I have, some fields, some constraints and > one index. I want to know (estimate) how much fisical space (KB, MB) it will > consume! > > > > > > Thanks in advance! > > > ------=_Part_15774_6132824.1158860998972 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
when you have dbsize installed you need to do
 
select relation_size('TableName');
 
to get the size of the table.

 
On 9/21/06, Rodrigo Sakai <rodrigo.sakai@zanthus.com.br> wrote:

  Hello all,

 

  I need a tool or something like it, which can give me the estimated size of a table considering all fields, constraints, indexes, etc...

 

  For example:

 

 

  CREATE TABLE products (

     product_id INT8,

     product_name VARCHAR(50),

     product_vendor VARCHAR(50),

     price NUMERIC(10,2),

 

     CONSTRAINT pk_products PRIMARY KEY (product_id),

     CONSTRAINT ck_price CHECK (price >= 0)

);

 

 

CREATE INDEX ix_products ON products (product_name);

 

 

  See that in the example above I have, some fields, some constraints and one index. I want to know (estimate) how much fisical space (KB, MB) it will consume!

 

 

  Thanks in advance!

   


------=_Part_15774_6132824.1158860998972--