Re: need vacuum after insert/truncate/insert?

From: Markus Schaber <schabi(at)logix-tt(dot)com>
To: "Craig A(dot) James" <cjames(at)modgraph-usa(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: need vacuum after insert/truncate/insert?
Date: 2006-07-07 08:32:07
Message-ID: 44AE1C07.60009@logix-tt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi, Craig,

Craig A. James wrote:
> If I insert a bunch of rows, then truncate, then insert a bunch more
> rows, do I need to vacuum? I've been assuming that TRUNCATE TABLE is a
> brute-force technique that more-or-less tosses the old table and starts
> fresh so that no vacuum is necessary.
>
> Second question: Same scenario as above, but now the table has indexes.
> Is a reindex needed, or are the indexes they "truncated" too?

AFAIK, both table and indices are "cut down" nicely.

But you will need an ANALYZE after refilling of the table, to have
current statistics.

HTH,
Markus

--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Markus Schaber 2006-07-07 08:33:31 Re: Update INSERT RULE while running for Partitioning
Previous Message Markus Schaber 2006-07-07 08:28:54 Re: getting better performance