Thread: Vacuum is needed or not?

Vacuum is needed or not?

From
Szabolcs BALLA
Date:
Hi,

How do I know vacuum is need or not? I mean, are there any query to know status of statistics, tables, indexes, etc?
(7.4.7)
Our database size bigger than just go and do it. :(

Thanks
Szabek

Re: Vacuum is needed or not?

From
Jaime Casanova
Date:
On 1/5/06, Szabolcs BALLA <szabolcs.balla@confinsystems.com> wrote:
> Hi,
>
> How do I know vacuum is need or not? I mean, are there any query to know
> status of statistics, tables, indexes, etc?

at least, once every billion transactions to be safe...

> (7.4.7)
> Our database size bigger than just go and do it. :(
>

ahh... then execute it once a week or once a day, for avoid excessive growing...

> Thanks
> Szabek
>
>


--
Atentamente,
Jaime Casanova
(DBA: DataBase Aniquilator ;)

Re: Vacuum is needed or not?

From
"Jim C. Nasby"
Date:
On Thu, Jan 12, 2006 at 11:21:19PM -0500, Jaime Casanova wrote:
> On 1/5/06, Szabolcs BALLA <szabolcs.balla@confinsystems.com> wrote:
> > Hi,
> >
> > How do I know vacuum is need or not? I mean, are there any query to know
> > status of statistics, tables, indexes, etc?
>
> at least, once every billion transactions to be safe...
>
> > (7.4.7)
> > Our database size bigger than just go and do it. :(
> >
>
> ahh... then execute it once a week or once a day, for avoid excessive growing...

Even once a day can be awefully conservative for many databases. Keep in
mind that every single row that is updated or deleted will hang around
in the database until you vacuum; on a busy system that can result in a
lot of wasted space. And once the bloat is there, it can be hard to get
rid of.

7.4.7 has contrib/pg_autovacuum, and I highly recommend it. Also,
http://lnk.nu/pervasive-postgres.com/7m4.asp and
http://lnk.nu/pervasive-postgres.com/7jd.asp might be interesting reads
for you.
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461