Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 2CC269FB629 for ; Mon, 9 Oct 2006 10:49:56 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 57793-03 for ; Mon, 9 Oct 2006 13:49:49 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.171]) by postgresql.org (Postfix) with ESMTP id A3AD29FB618 for ; Mon, 9 Oct 2006 10:49:48 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id 30so573883ugc for ; Mon, 09 Oct 2006 06:49:46 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=lacksLwnpusqjmCoVoNSExRVsDn6z0VEcV3YP+YCOQ/x+zSz6kNrZrG4lLADlQ770poyIxyk2dbKuUBniupzi8BW+8oTNfVa1pG8PpxcfzSvKOYPNAdBQxdlFvIwKYNHSNfKxGtBnl3ZJ8JI2E4sH1p831ae0Xi7QWb0BGlVWrg= Received: by 10.78.127.2 with SMTP id z2mr1756083huc; Mon, 09 Oct 2006 06:49:46 -0700 (PDT) Received: by 10.78.35.18 with HTTP; Mon, 9 Oct 2006 06:49:45 -0700 (PDT) Message-ID: Date: Mon, 9 Oct 2006 09:49:46 -0400 From: "Merlin Moncure" To: "Carlo Stonebanks" Subject: Re: Performance Optimization for Dummies 2 - the SQL Cc: pgsql-performance@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1160153623.6181.13.camel@state.g2switchworks.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.199 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, SPF_PASS X-Spam-Level: X-Archive-Number: 200610/155 X-Sequence-Number: 21284 On 10/6/06, Carlo Stonebanks wrote: > > how did you determine that it is done every 500 rows? this is the > > The import program pages the import table - it is currently set at 500 rows > per page. With each page, I run an ANALYZE. right, i just wanted to make sure of something (you are doing it properly). really, analyze only needs to be run when tables go up an order of mangitude in size or so, or a little bit less...like when the table grows 50% or so. > > default autovacuum paramater. if you followed my earlier > > recommendations, you are aware that autovacuum (which also analyzes) > > is not running during bulk inserts, right? > It's intuitivly obvious, but I can't do bulk inserts. It's just not the > nature of what we are doing with the data. right. > This is currently being done programmatically. The nature of what we're > doing is suited for imperitive, navigational logic rather than declarative, > data set logic; just the opposite of what SQL likes, I know! If there's some > way to replace thousands of lines of analysis and decision trees with > ultrafast queries - great... > > > important feature of analyze is to tell the planner approx. how big > > the tables are. > > But the tables grow as the process progresses - would you not want the > server to re-evaluate its strategy periodically? yes, but it makes the most difference when the tables are small so as to keep the planner from doing seqscans as they grow. well it looks like you are on the right track, hopefully the process runs in an acceptable amount of time at this point. merlin