Re: table and index size - Mailing list pgsql-general

From Tom Lane
Subject Re: table and index size
Date
Msg-id 15269.1026737683@sss.pgh.pa.us
Whole thread Raw
In response to Re: table and index size  (Curt Sampson <cjs@cynic.net>)
List pgsql-general
Curt Sampson <cjs@cynic.net> writes:
> On Mon, 15 Jul 2002, Damon Fasching wrote:
>> Is there a way to determine the size of a table? an index?

> The pg_class table has the size of every object in (usually 8K) pages. So:

>     SELECT relname, reltype, relpages, relpages / 128 AS MB
>     FROM pg_class
>     WHERE relname LIKE 'session%'

Note that those numbers are only up to date if you've vacuumed recently.

>> I created a table with two int4 columns and inserted 100 K rows.  The
>> change in disk usage was only 4.3 KBytes, or .17 bits per integer.

> Something's wrong there. Did you sync? 430 KB I'd believe.

I'd believe 4300 KB, but not anything much less than that.
I doubt sync has anything to do with it; I'd wonder whether he
was du'ing the right place with the right privileges.  $PGDATA is
normally not readable by anyone except the postgres user...

            regards, tom lane

pgsql-general by date:

Previous
From: Steve Brett
Date:
Subject: Re: help (maybe i'm a little stupid)
Next
From: Tom Lane
Date:
Subject: Re: okay so i deleted pg_log .....