Re: How can I known the size of a database, table by table

Поиск
Список
Период
Сортировка
От Steve Crawford
Тема Re: How can I known the size of a database, table by table
Дата
Msg-id 44282957.2070508@pinpointresearch.com
обсуждение исходный текст
Ответ на How can I known the size of a database, table by table ?  (Bruno Baguette <pgsql-ml@baguette.net>)
Список pgsql-general
Bruno Baguette wrote:
> Hello,
>
> I works on a PostgreSQL 8.0.4 database, and I would like to known the
> size (in bytes, Mbytes or anything else) of that database, for each table.
>
> How can I do that ?
>
> Thanks in advance !
>

This will probably work for you (in bytes - or you could divide by 8
instead for KB):

select relpages*8192 from pg_class where relname = 'your_table_name';

8k page size is typical but you may need to verify this for your system.
Also, there may be toast tables associated with your main table so you
could need to add their sizes to your total for the table.

See the manual section on monitoring disk usage for more
complete/accurate info:
http://www.postgresql.org/docs/8.1/interactive/diskusage.html


Cheers,
Steve

В списке pgsql-general по дате отправления:

Предыдущее
От: Leon Pu
Дата:
Сообщение: Re: PostgreSQL support on Redhat Advance Server 2.1
Следующее
От: Kevin Murphy
Дата:
Сообщение: Re: How can I known the size of a database, table by table ?