Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id EF5A49FB734 for ; Fri, 18 May 2007 08:52:35 -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 92313-01 for ; Fri, 18 May 2007 08:52:32 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail.livius.net (mail.livius.net [80.86.96.82]) by postgresql.org (Postfix) with ESMTP id CF24F9FB6FF for ; Fri, 18 May 2007 08:52:31 -0300 (ADT) Received: from ilgvaio (86-120-229-138.rdsnet.ro [86.120.229.138] (may be forged)) (authenticated bits=0) by mail.livius.net (8.12.5/8.12.5) with ESMTP id l4IBqSeF012040 for ; Fri, 18 May 2007 14:52:29 +0300 From: "Liviu Ionescu" To: Subject: Re: performance drop on 8.2.4, reverting to 8.1.4 Date: Fri, 18 May 2007 14:51:42 +0300 Message-ID: <008901c79942$e7136e10$653e10ac@ilgvaio> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6822 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Thread-Index: AceZPnVmzuN8eh0iSKy5pUZyV78lJgAAopaQ In-Reply-To: <20070518111455.GA13978@uio.no> Importance: Normal X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/318 X-Sequence-Number: 24708 > This seems to be the source of the misestimation. You might=20 > want to try using "n WHERE n.nodein NOT IN (SELECT nodeid=20 > FROM templates)" instead of "n LEFT JOIN templates USING=20 > (nodeid) WHERE templates.nodeid IS NULL" and see if it helps. it helped, the new version of the query takes 2303 ms on both 8.1.4 and = 8.2.4. any idea why the 8.2.4 planner is not happy with the initial select? was = it just a big chance that it worked in 8.1.4 or the 8.2.4 planner has a = problem? or, from another perspective, is the new syntax more portable? what are = the chances that after upgrading to 8.3.x to encounter new problems? regards, Liviu