Re: storage calculations

Lists: pgsql-admin
From: pgboy(at)guthrie(dot)charm(dot)net
To: mendola(at)bigfoot(dot)com, pgsql-admin(at)postgresql(dot)org
Cc: pgboy(at)guthrie(dot)charm(dot)net
Subject: Re: storage calculations
Date: 2003-07-30 11:43:17
Message-ID: 20030730114317.3F7E113E23@guthrie.charm.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

sorry, when i referred to "disk space used" i meant the actual
amount used by live rows. if i insert 1000 rows then delete
999 of them, the disk file will be the size of the 100 row
container (make that 1000, not 100 - i cannot backspace here)
until i do a "vacuum full" - which does a table lock, which is
a bad thing.

given that, i'd like to try to be able to calculate the number of
bytes a row uses given its schema. i've seen this kind of
documentation for other dbs, i just cannot seem to find it
in the postgresql docs.

thanks.
pg


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgboy(at)guthrie(dot)charm(dot)net
Cc: mendola(at)bigfoot(dot)com, pgsql-admin(at)postgresql(dot)org
Subject: Re: storage calculations
Date: 2003-07-31 09:01:24
Message-ID: Pine.LNX.4.56.0307301424060.1171@krusty.credativ.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

pgboy(at)guthrie(dot)charm(dot)net writes:

> sorry, when i referred to "disk space used" i meant the actual amount
> used by live rows. if i insert 1000 rows then delete 999 of them, the
> disk file will be the size of the 100 row container (make that 1000, not
> 100 - i cannot backspace here) until i do a "vacuum full" - which does a
> table lock, which is a bad thing.

The task that you originally described was that you want to monitor when
the disk is getting full. For that task, you need to take into account
the actual size of the data on disk, not the size after a "vacuum full"
which you say you do not want to execute. Basing a disk full monitor on
hypothetical sizes sounds pretty useless.

> given that, i'd like to try to be able to calculate the number of
> bytes a row uses given its schema. i've seen this kind of
> documentation for other dbs, i just cannot seem to find it
> in the postgresql docs.

There is some information about that in the FAQ, but keep in mind that
rows may be compressed or moved to secondary storage automatically.

--
Peter Eisentraut peter_e(at)gmx(dot)net