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

Поиск
Список
Период
Сортировка
От Shoaib Mir
Тема Re: How can I known the size of a database, table by table ?
Дата
Msg-id bf54be870603270938w28798f9blc61b5c98e58074a5@mail.gmail.com
обсуждение исходный текст
Ответ на How can I known the size of a database, table by table ?  (Bruno Baguette <pgsql-ml@baguette.net>)
Список pgsql-general
The space occupied by your database and tables can be found this way:

# select oid from pg_database where datname='mybase';

 oid 
-------
 17239
(1 row)

$ du -hs data/base/17239
13.5 M

For getting a table size to get an approx size you can do the following:

SELECT relpages * 8192 AS size_in_bytes
FROM pg_class
WHERE

relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = '<schema name>') AND

   relname = '<table name>';

/Shoaib



On 3/27/06, Bruno Baguette < pgsql-ml@baguette.net> 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 !

--
Bruno BAGUETTE

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

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

Предыдущее
От: Andreas Kretschmer
Дата:
Сообщение: Re: How can I known the size of a database, table by table ?
Следующее
От: Chris Travers
Дата:
Сообщение: Re: Advantages of PostgreSQL over MySQL 5.0