Thread: Estimating a table size

Estimating a table size

From
"Rodrigo Sakai"
Date:

  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!

   

Re: Estimating a table size

From
"Guido Barosio"
Date:
there used to be a dbsize project, search for it.

g.-
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!
>
>


--
Guido Barosio
-----------------------
http://www.globant.com
guido.barosio@globant.com

Re: Estimating a table size

From
"Talha Khan"
Date:
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!

   


Re: Estimating a table size

From
"Shoaib Mir"
Date:
http://www.postgresql.org/docs/8.1/static/diskusage.html can help you get this information.

Thanks,
--
Shoaib Mir
EnterpriseDB ( www.enterprisedb.com)

On 9/21/06, Guido Barosio <gbarosio@gmail.com> wrote:
there used to be a dbsize project, search for it.

g.-
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!
>
>


--
Guido Barosio
-----------------------
http://www.globant.com
guido.barosio@globant.com

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings