X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id E9BAF9FA65C for ; Fri, 7 Jul 2006 05:31:59 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 27660-05 for ; Fri, 7 Jul 2006 05:31:51 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) by postgresql.org (Postfix) with ESMTP id 584AB9FA66C for ; Fri, 7 Jul 2006 05:31:51 -0300 (ADT) Received: from kingfisher.intern.logix-tt.com (p549D142A.dip0.t-ipconnect.de [84.157.20.42]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logix-tt.com (Postfix) with ESMTP id E23A0656C1; Fri, 7 Jul 2006 10:33:31 +0200 (CEST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 3BEF61852EF8A; Fri, 7 Jul 2006 10:32:08 +0200 (CEST) Message-ID: <44AE1C07.60009@logix-tt.com> Date: Fri, 07 Jul 2006 10:32:07 +0200 From: Markus Schaber Organization: Logical Tracking and Tracing International AG, Switzerland User-Agent: Thunderbird 1.5.0.2 (X11/20060516) MIME-Version: 1.0 To: "Craig A. James" Cc: pgsql-performance@postgresql.org Subject: Re: need vacuum after insert/truncate/insert? References: <20060706200652.50294.qmail@web55911.mail.re3.yahoo.com> <44ADBDB8.5010008@modgraph-usa.com> In-Reply-To: <44ADBDB8.5010008@modgraph-usa.com> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/62 X-Sequence-Number: 19922 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