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 48E625E46E1 for ; Wed, 25 Aug 2004 11:31:17 -0300 (ADT) 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 88495-09 for ; Wed, 25 Aug 2004 14:31:08 +0000 (GMT) Received: from ucsns.ucs.co.za (ucs.co.za [196.23.43.2]) by svr1.postgresql.org (Postfix) with ESMTP id 5D1FC5E46C3 for ; Wed, 25 Aug 2004 11:30:58 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by ucsns.ucs.co.za (Postfix) with ESMTP id 382972BD7A; Wed, 25 Aug 2004 16:30:49 +0200 (SAST) Received: from ucsns.ucs.co.za ([127.0.0.1]) by localhost (ucsns.ucs.co.za [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 19339-01; Wed, 25 Aug 2004 16:30:41 +0200 (SAST) Received: from ucspost.ucs.co.za (mailgw1.ucs.co.za [196.23.43.253]) by ucsns.ucs.co.za (Postfix) with ESMTP id 851CC2BD49; Wed, 25 Aug 2004 16:30:41 +0200 (SAST) Received: from jhb.ucs.co.za (jhb.ucs.co.za [172.31.1.3]) by ucspost.ucs.co.za (Postfix) with ESMTP id D0834D9E25; Wed, 25 Aug 2004 16:30:41 +0200 (SAST) Received: from svb.ucs.co.za (svb.ucs.co.za [172.31.1.148]) by jhb.ucs.co.za (Postfix) with SMTP id 9BFEE97642; Wed, 25 Aug 2004 16:30:41 +0200 (SAST) Date: Wed, 25 Aug 2004 16:30:41 +0200 From: Stef To: Tom Lane Cc: pgsql-performance@postgresql.org Subject: Re: Query kills machine. Message-Id: <20040825163041.716d2103@svb.ucs.co.za> In-Reply-To: <4015.1093361011@sss.pgh.pa.us> References: <20040824103240.4d909777@svb.ucs.co.za> <412B05A2.8070301@familyhealth.com.au> <20040824153014.2a11d228@svb.ucs.co.za> <4015.1093361011@sss.pgh.pa.us> X-Mailer: Sylpheed-Claws 0.9.12 (GTK+ 1.2.10; i386-pc-linux-gnu) User-Agent: sillypheed-claws (anti-aliased) X-Face: GFoC95e6r)_TTG>n~=uFLojP=O~4W@Ms]>:.DMm/')(z3\Mwj^XP@? Q:3";lD.OM1"^mDu}2NJ@US:)dO:U*iY5EM50&Tx. X-Operating-System: sid X-X-X: _-^-_ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at ucs.co.za 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: 200408/338 X-Sequence-Number: 7974 Tom Lane mentioned : => Not if you haven't got the RAM to support it :-( => => Another thing you might look at is ANALYZEing the tables again after => you've loaded all the new data. The row-count estimates seem way off => in these plans. You might need to increase the statistics target, => too, to get better plans. Thanks Tom, Christopher and Magnus! I tested this, and found the correct sort_mem setting for my situation. I'm testing a new default_statistics_target setting. This is something I never considered. Kind Regards Stefan