X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2DE3232A7BC for ; Thu, 21 Oct 2004 23:21:39 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 86184-10 for ; Thu, 21 Oct 2004 22:21:34 +0000 (GMT) Received: from server.gpdnet.co.uk (gpdnet.plus.com [212.56.100.243]) by svr1.postgresql.org (Postfix) with ESMTP id 859C532A79B for ; Thu, 21 Oct 2004 23:21:35 +0100 (BST) Received: from gary (unknown [192.168.1.2]) by server.gpdnet.co.uk (Postfix) with ESMTP id 38221FBBB7 for ; Thu, 21 Oct 2004 23:22:11 +0100 (BST) From: "Gary Doades" To: pgsql-performance@postgresql.org Date: Thu, 21 Oct 2004 23:21:35 +0100 MIME-Version: 1.0 Subject: Re: Performance Anomalies in 7.4.5 Message-ID: <4178447F.961.6D7BBB5B@localhost> In-reply-to: References: X-mailer: Pegasus Mail for Windows (v4.12a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/372 X-Sequence-Number: 8848 On 21 Oct 2004 at 15:50, Thomas F.O'Connell wrote: > If not, should I be REINDEXing manually, as well as VACUUMing manually > after large data imports (whether via COPY or INSERT)? Or will a VACUUM > FULL ANALYZE be enough? > It's not the vacuuming that's important here, just the analyze. If you import any data into a table, Postgres often does not *know* that until you gather the statistics on the table. You are simply running into the problem of the planner not knowing how much data/distribution of data in your tables. If you have large imports it may be faster overall to drop the indexes first, then insert the data, then put the indexes back on, then analyze. Cheers, Gary.