Re: Big delete on big table... now what?

From: Bill Moran <wmoran(at)collaborativefusion(dot)com>
To: "Fernando Hevia" <fhevia(at)ip-tel(dot)com(dot)ar>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Big delete on big table... now what?
Date: 2008-08-22 22:44:07
Message-ID: 20080822184407.37155367.wmoran@collaborativefusion.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Fernando Hevia" <fhevia(at)ip-tel(dot)com(dot)ar> wrote:
>
> Hi list.
>
> I have a table with over 30 million rows. Performance was dropping steadily
> so I moved old data not needed online to an historic table. Now the table
> has about 14 million rows. I don't need the disk space returned to the OS
> but I do need to improve performance. Will a plain vacuum do or is a vacuum
> full necessary?
> ¿Would a vacuum full improve performance at all?

If you can afford the downtime on that table, cluster would be best.

If not, do the normal vacuum and analyze. This is unlikely to improve
the performance much (although it may shrink the table _some_) but
regular vacuum will keep performance from getting any worse.

You can also reindex pretty safely. Any queries that run during the
reindex will just have to do so without the indexes.

Longer term, if you remove smaller groups of rows more frequently, you'll
probably be able to maintain performance and table bloat at a reasonable
level with normal vacuum.

--
Bill Moran
Collaborative Fusion Inc.

wmoran(at)collaborativefusion(dot)com
Phone: 412-422-3463x4023

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Gregory Stark 2008-08-23 00:39:56 Re: Big delete on big table... now what?
Previous Message Kevin Grittner 2008-08-22 21:30:59 Re: Big delete on big table... now what?