pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
need vacuum after insert/truncate/insert?
2+ messages / 2 participants
[nested] [flat]

* need vacuum after insert/truncate/insert?
@ 2006-07-07 01:49 Craig A. James <cjames@modgraph-usa.com>
  2006-07-07 08:32 ` Re: need vacuum after insert/truncate/insert? Markus Schaber <schabi@logix-tt.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Craig A. James @ 2006-07-07 01:49 UTC (permalink / raw)
  To: pgsql-performance

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?

Thanks,
Craig




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: need vacuum after insert/truncate/insert?
  2006-07-07 01:49 need vacuum after insert/truncate/insert? Craig A. James <cjames@modgraph-usa.com>
@ 2006-07-07 08:32 ` Markus Schaber <schabi@logix-tt.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Markus Schaber @ 2006-07-07 08:32 UTC (permalink / raw)
  To: Craig A. James <cjames@modgraph-usa.com>; +Cc: 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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2006-07-07 08:32 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-07-07 01:49 need vacuum after insert/truncate/insert? Craig A. James <cjames@modgraph-usa.com>
2006-07-07 08:32 ` Markus Schaber <schabi@logix-tt.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox