storage calculations

From: pgboy(at)guthrie(dot)charm(dot)net
To: pgsql-admin(at)postgresql(dot)org
Subject: storage calculations
Date: 2003-07-29 18:09:26
Message-ID: 20030729180926.EFE0913EA6@guthrie.charm.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

i've been browsing the documentation online, and i can't
find where the storage layouts for tables and indexes are
explained.

i'd like to be able to figure out, given a table or two
with a simple schema (no ineritance) and some indexes, and
a number of rows currently in these tables, how much disk
space is being used.

the underlying problem being worked here, by the way, is
to come up with a task that monitors space used by the database
so as to issue a warning of some sort when the partition
upon which the database resides is getting full. i had originally
used the statfs output from the (unix) os, but for this to accurately
reflect the "used" space, i found i had to do a "vacuum full" and
compress the database. i'd rather come up with a heuristic where
i can take a number of rows (which i get from the reltuples column
in pg_class, which seems to be accurate after running 'analyze')
and multiply by some number i have calculated based on the table
schema to get a fairly accurate guess at the real space used.

any and all advice welcome, and thanks.

pg

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Renney Thomas 2003-07-29 18:36:19 7.3.4 and OpenSSl
Previous Message Judy Chun 2003-07-29 18:08:57 handling different languages in a database