Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 255B99FC335 for ; Fri, 18 May 2007 19:35:36 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 31152-05-2 for ; Fri, 18 May 2007 19:35:31 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from cassarossa.samfundet.no (cassarossa.samfundet.no [129.241.93.19]) by postgresql.org (Postfix) with ESMTP id C72119FC349 for ; Fri, 18 May 2007 19:35:31 -0300 (ADT) Received: from trofast.sesse.net ([129.241.93.32]) by cassarossa.samfundet.no with esmtp (Exim 4.50) id 1HpB2o-0000aQ-1d for pgsql-performance@postgresql.org; Sat, 19 May 2007 00:35:30 +0200 Received: from sesse by trofast.sesse.net with local (Exim 3.36 #1 (Debian)) id 1HpB2n-0004dx-00 for ; Sat, 19 May 2007 00:35:29 +0200 Date: Sat, 19 May 2007 00:35:29 +0200 From: "Steinar H. Gunderson" To: pgsql-performance@postgresql.org Subject: Re: CPU Intensive query Message-ID: <20070518223529.GC17690@uio.no> Mail-Followup-To: pgsql-performance@postgresql.org References: <20070518164210.GA15372@uio.no> <545855.84387.qm@web57106.mail.re3.yahoo.com> <20070518223233.GB17690@uio.no> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20070518223233.GB17690@uio.no> X-Operating-System: Linux 2.6.20.4 on a x86_64 X-Message-Flag: Outlook? --> http://www.mozilla.org/products/thunderbird/ User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/354 X-Sequence-Number: 24744 On Sat, May 19, 2007 at 12:32:33AM +0200, Steinar H. Gunderson wrote: > Did you ANALYZE your tables recently? If the joins are really between > millions of rows and the planner thinks it's a couple thousands, the stats > sound rather off... Sorry, I forgot your first e-mail where you said you had both vacuumed and analyzed recently. The estimates are still off, though -- the WHERE query might be difficult to estimate properly. (I'm not sure how Tom arrived on his conclusion of expensive user-defined functions, but given the usual precisions of his guesses, I'd check that too...) /* Steinar */ -- Homepage: http://www.sesse.net/