Re: table disk space usage query?

Поиск
Список
Период
Сортировка
От Dimitri Fontaine
Тема Re: table disk space usage query?
Дата
Msg-id 200707021148.19799.dfontaine@hi-media.com
обсуждение исходный текст
Ответ на table disk space usage query?  (lawpoop@gmail.com)
Список pgsql-general
Le jeudi 28 juin 2007, lawpoop@gmail.com a écrit :
> Hello all -
>
> I was looking for a way to find out how much disk space each table is
> using.

As of PostgreSQL 8.1 you can use the following:
http://www.postgresql.org/docs/8.1/static/functions-admin.html#FUNCTIONS-ADMIN-DBSIZE

Example query to obtain per-table on-disk size:

select tablename,
        pg_size_pretty(pg_relation_size(tablename)) as size,
        pg_size_pretty(pg_total_relation_size(tablename)) as total,
        pg_relation_size(tablename)
from  pg_tables
where schemaname = 'public' and tablename !~ '^pg_'
order by 4 desc;

Regards,
--
dim

Вложения

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

Предыдущее
От: Gerhard Hintermayer
Дата:
Сообщение: ERROR: unexpected hash relation size:
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: shmctl EIDRM preventing startup