Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 94A421337B6F for ; Wed, 10 Nov 2010 08:38:55 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 37872-10 for ; Wed, 10 Nov 2010 12:38:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 71CC01337B77 for ; Wed, 10 Nov 2010 08:38:48 -0400 (AST) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Wed, 10 Nov 2010 06:38:47 -0600 Message-Id: <4CDA3DF302000025000374F7@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Wed, 10 Nov 2010 06:38:43 -0600 From: "Kevin Grittner" To: , Cc: Subject: Re: anti-join chosen even when slower than old plan Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.21 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/134 X-Sequence-Number: 41158 Grzegorz Jaƛkiewicz wrote: > you're joining on more than one key. That always hurts performance. That's very clearly *not* the problem, as there is a plan which runs in acceptable time but the optimizer is not choosing without being coerced. (1) Virtually every query we run joins on multi-column keys, yet we have good performance except for this one query. (2) We're talking about a performance regression due to a new release picking a newly available plan which it wrongly estimates to be an order of magnitude faster, when it's actually more than five times slower. -Kevin