Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 5D9CB9FC221 for ; Fri, 18 May 2007 08:15:02 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 21286-02 for ; Fri, 18 May 2007 08:14:58 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from cassarossa.samfundet.no (cassarossa.samfundet.no [129.241.93.19]) by postgresql.org (Postfix) with ESMTP id A1A889FB841 for ; Fri, 18 May 2007 08:14:58 -0300 (ADT) Received: from trofast.sesse.net ([129.241.93.32]) by cassarossa.samfundet.no with esmtp (Exim 4.50) id 1Hp0QC-0005ul-2p for pgsql-performance@postgresql.org; Fri, 18 May 2007 13:14:56 +0200 Received: from sesse by trofast.sesse.net with local (Exim 3.36 #1 (Debian)) id 1Hp0QB-0003e7-00 for ; Fri, 18 May 2007 13:14:55 +0200 Date: Fri, 18 May 2007 13:14:55 +0200 From: "Steinar H. Gunderson" To: pgsql-performance@postgresql.org Subject: Re: performance drop on 8.2.4, reverting to 8.1.4 Message-ID: <20070518111455.GA13978@uio.no> Mail-Followup-To: pgsql-performance@postgresql.org References: <20070518104646.GA13811@uio.no> <008201c7993c$76c88a10$653e10ac@ilgvaio> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <008201c7993c$76c88a10$653e10ac@ilgvaio> 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/317 X-Sequence-Number: 24707 On Fri, May 18, 2007 at 02:05:36PM +0300, Liviu Ionescu wrote: > " -> Hash Left Join (cost=2.44..63.29 rows=1 width=49) (actual time=0.361..14.426 rows=2206 loops=1)" > " Hash Cond: (n.nodeid = templates.nodeid)" > " Filter: (templates.nodeid IS NULL)" > " -> Seq Scan on nodes n (cost=0.00..51.70 rows=2270 width=49) (actual time=0.071..4.417 rows=2270 loops=1)" > " -> Hash (cost=1.64..1.64 rows=64 width=4) (actual time=0.152..0.152 rows=64 loops=1)" > " -> Seq Scan on templates (cost=0.00..1.64 rows=64 width=4) (actual time=0.032..0.082 rows=64 loops=1)" This seems to be the source of the misestimation. You might want to try using "n WHERE n.nodein NOT IN (SELECT nodeid FROM templates)" instead of "n LEFT JOIN templates USING (nodeid) WHERE templates.nodeid IS NULL" and see if it helps. > "Total runtime: 231929.656 ms" Note that this is better than the version with collapse_limit set to 1. :-) /* Steinar */ -- Homepage: http://www.sesse.net/