Обсуждение: Space usage

Поиск
Список
Период
Сортировка

Space usage

От
Anantha V Padmanaban
Дата:
Hi All

Version 8.1

I am new to postgres and trying to find a way to get the actual space usage of a table. The table size is 28GB but I have deleted a lot of rows which is not getting reflected. I presume the space will be reclaimed after the vacuum process. But I would like to know how much space left in the database. Is there anyway we can find how much space will be released after vacuuming process?

Thanks
AP





Match ‘n’ Make new friends with the cool match-meter. Join the Planet with you Hotmail ID. Drag n’ drop

Re: Space usage

От
"Kevin Grittner"
Дата:
Anantha V Padmanaban <ananthin@hotmail.com> wrote:

> Version 8.1

It's generally best to give a full version number; many problems exist
in 8.1.0 that don't exist in 8.1.17.  Hopefully you're on the latest
bug fix release.

http://www.postgresql.org/support/versioning

> I am new to postgres

Then you should probably be looking at 8.3.latest or 8.4.latest, not
8.1.

> and trying to find a way to get the actual space usage of a table.
> The table size is 28GB but I have deleted a lot of rows which is
> not getting reflected. I presume the space will be reclaimed after
> the vacuum process.

A normal vacuum will free the space for reuse within the database, it
will not release it back to the OS.  To do that you would need to use
VACUUM FULL (followed by REINDEX) or CLUSTER.  These are aggressive
maintenance operations, which should not normally be needed.

> But I would like to know how much space left in the database. Is
> there anyway we can find how much space will be released after
> vacuuming process?

Someone might be able to suggest something simpler, but you can pick
an interesting query (after the comment "this was fun to write") from
the pl script here:

http://bucardo.org/nagios_postgres/

-Kevin