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

From Tom Lane
Subject Re: Table size does not include toast size
Date
Msg-id 16681.1261414446@sss.pgh.pa.us
Whole thread Raw
In response to Re: Table size does not include toast size  (Greg Smith <greg@2ndquadrant.com>)
Responses Re: Table size does not include toast size  (Greg Smith <greg@2ndquadrant.com>)
Re: Table size does not include toast size  (Cédric Villemain <cedric.villemain.debian@gmail.com>)
List pgsql-hackers
Greg Smith <greg@2ndquadrant.com> writes:
> To answer Rafael's concerns directly:  you're right that this is 
> confusing.  pg_relation_size is always going to do what it does right 
> now just because of how that fits into the design of the database.  
> However, the documentation should be updated to warn against the issue 
> with TOAST here.  And it should be easier to get the total you're like 
> to see here:  main relation + toasted parts, since that's what most DBAs 
> want in this area.

Perhaps invent    pg_table_size() = base table + toast table + toast index
and        pg_indexes_size() = all other indexes for table
giving us the property pg_table_size + pg_indexes_size =
pg_total_relation_size

I think the 8.4 documentation already makes it apparent that
pg_relation_size is a pretty low-level number.  If we invent other
functions with obvious names, that should be sufficient.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Greg Smith
Date:
Subject: Re: Table size does not include toast size
Next
From: Greg Smith
Date:
Subject: Re: Table size does not include toast size