Re: Table size does not include toast size

From: Cédric Villemain <cedric(dot)villemain(dot)debian(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Smith <greg(at)2ndquadrant(dot)com>, Bernd Helmle <mailings(at)oopsware(dot)de>, Rafael Martinez <r(dot)m(dot)guerrero(at)usit(dot)uio(dot)no>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Table size does not include toast size
Date: 2009-12-22 10:46:32
Message-ID: e94e14cd0912220246j361bdf0bif55f6ce666f42c95@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2009/12/21 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Greg Smith <greg(at)2ndquadrant(dot)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

Did you mean :
pg_table_size() = base table + toast table
pg_indexes_size() = base indexes + toast indexes
?

>
> 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
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Cédric Villemain 2009-12-22 10:51:55 Re: Buffer statistics for pg_stat_statements
Previous Message Takahiro Itagaki 2009-12-22 10:45:55 Re: New VACUUM FULL