Re: Table size does not include toast size - Mailing list pgsql-hackers

From Rafael Martinez
Subject Re: Table size does not include toast size
Date
Msg-id 4B2F9349.6070309@usit.uio.no
Whole thread Raw
In response to Re: Table size does not include toast size  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Table size does not include toast size  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tom Lane wrote:
> Rafael Martinez <r.m.guerrero@usit.uio.no> writes:
>> I wonder why the function pg_relation_size(text) does not take into
>> account the space used by toast data in a table when returning the space
>> used by the table.
> 
> It's not supposed to.  Use pg_total_relation_size if you want a number
> that includes index and toast space.
> 

I am probably missing the point here, why is it not supposed to show the
size of the table(data) *without* indexes?

My question was because I can not understand the use and usefulness of
pg_relation_size() (as it works today) in a table that use toast.

- From an administrator point of view, there are two numbers that are
interesting, the total size of a table (indexes included) and the size
of the table without taking into account the space used by its indexes.

At least, if there is a logic in this behavior, it should be documented
in "9.23. System Administration Functions". The documentation only says
"Disk space used by the table or index with ...."

It is not the first time confused users have asked me why
pg_relation_size() does not show the space used by the table without
indexes. Many do not know what 'toast' is, and most probably they do not
need to know about this either.

regards,
- --Rafael Martinez, <r.m.guerrero@usit.uio.no>Center for Information Technology ServicesUniversity of Oslo, Norway
PGP Public Key: http://folk.uio.no/rafael/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.7 (GNU/Linux)

iD8DBQFLL5NCBhuKQurGihQRAmtZAJ99wJPKbS1u2RUGxO4G++X7nbqt2gCeJubn
b+328nrEICsXPS7kgD4bq68=
=bBO8
-----END PGP SIGNATURE-----


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: An example of bugs for Hot Standby
Next
From: Bernd Helmle
Date:
Subject: Re: Table size does not include toast size