Re: A question about Vacuum analyze

From: Ragnar <gnari(at)hive(dot)is>
To: emilu(at)encs(dot)concordia(dot)ca
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: A question about Vacuum analyze
Date: 2006-02-16 15:05:03
Message-ID: 1140102303.32324.44.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On fim, 2006-02-16 at 09:12 -0500, Emi Lu wrote:
> Hello,
>
> We have a daily cronjob and in the cronjob we do:
> 1. truncate one table A
> 2. insert into table A
> 3. do comparision table A and table B and update table B accordingly
>
> The doc says "VACUUM ANALYZE command for the affected table. This will
> update the system catalogs with the results of all recent changes, and
> allow the PostgreSQL query planner to make better choices in planning
> queries".
> So, I believe after insertion at step 2, comparision will be speed up if
> we do a "vacuum analyze" right?

after only truncate and inserts , vacuum is not needed,
but ANALYZE is good.

> In another way, whenever we "delete/truncate and then insert" data into
> a table, it is better to "vacuum anaylze"?

after deleting or updating a significant percentage of
rows, VACUUM can be called for, but usually VACUUM is
done as part of regular maintenance, or by autovacuum.

gnari

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Reid Thompson 2006-02-16 15:07:00 Re: Oracle tried to buy MySQL
Previous Message John Zubac 2006-02-16 14:44:31 Re: Oracle tried to buy MySQL