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 4B2F9648.8080305@usit.uio.no
Whole thread Raw
In response to Re: Table size does not include toast size  (Bernd Helmle <mailings@oopsware.de>)
List pgsql-hackers
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bernd Helmle wrote:
> 
> 
> --On 21. Dezember 2009 10:01:37 -0500 Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 
>> It's not supposed to.  Use pg_total_relation_size if you want a number
>> that includes index and toast space.
> 
> I've created a C-Function a while ago that extracts the TOAST size for a
> given relation. This gave me the opportunity to do a
> pg_relation_size(oid) + pg_relation_toast_size(oid) for a given table
> oid to calculate on disk data size required by a table. Maybe we should
> include such a function in core?
> 

It is a possibility. But I really think that pg_relation_size() not
reporting the total size of the table (without indexes) is useless.

toast is an internal way of organizing/saving data for tuples larger
than the page size used by PostgreSQL. It is a mechanism transparent to
the user and therefore pg_relation_size() should not differentiate
between data saved via toast or not.

The size of the table without the indexes should be reported regardless
the technique used to save the data on the disk.

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)

iD8DBQFLL5ZHBhuKQurGihQRAoR8AJ97RoST3VHGCmcIOhkdRbJIWb3mnwCeN7Mm
7Oja4kmyrQfM6/RxyUE4K2A=
=kxO9
-----END PGP SIGNATURE-----


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Table size does not include toast size
Next
From: Tom Lane
Date:
Subject: Re: Small Bug in GetConflictingVirtualXIDs