Re: VACUUM not doing its job?

From: Ken Corey <ken(at)kencorey(dot)com>
To: Kristian Eide <kreide(at)online(dot)no>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: VACUUM not doing its job?
Date: 2002-08-03 22:14:43
Message-ID: 1028412884.28635.22.camel@kenlinux.bithub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I've run into this myself. Tom lane helped me out.

In my case, it was the fact that indexes don't release the space of
indexes of deleted rows. So, if you have a table that has a lot of
inserts/deletes, your indexes will grow incredibly fast.

The way to see what your biggest items are:

select * from pg_class order by relpages desc;

If your tables are active with lots of inserts/deletes, the biggest
things will likely be indexes.

The only way that I know to recover this space is to drop the indexes
and recreate them. Vacuum didn't touch them for me.

-Ken

On Sat, 2002-08-03 at 21:53, Kristian Eide wrote:
> Three week ago we did a pg_dump/pg_restore, and after pgsql/data/ took about
> 750MB. Now it uses 2,4GB of disk space! If we do a new complete dump and
> restore the volume will decrease to about 800MB.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Kristian Eide 2002-08-03 22:40:57 Re: VACUUM not doing its job?
Previous Message Kristian Eide 2002-08-03 21:11:40 Bug with dump/restore when using UNION and ORDER BY in views