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 1F3F6D1B37A for ; Thu, 10 Jun 2004 12:59:11 -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 02911-07 for ; Thu, 10 Jun 2004 15:59:08 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id DBF00D1B2A8 for ; Thu, 10 Jun 2004 12:59:07 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i5AFx5ZS025305; Thu, 10 Jun 2004 11:59:05 -0400 (EDT) To: Jean-Luc Lachance Cc: pgsql-performance@postgresql.org, Frank van Vugt Subject: Re: *very* inefficient choice made by the planner (regarding In-reply-to: <40C881FE.5000301@sympatico.ca> References: <200406101624.21739.ftm.van.vugt@foxi.nl> <40C881FE.5000301@sympatico.ca> Comments: In-reply-to Jean-Luc Lachance message dated "Thu, 10 Jun 2004 11:45:02 -0400" Date: Thu, 10 Jun 2004 11:59:05 -0400 Message-ID: <25304.1086883145@sss.pgh.pa.us> From: Tom Lane 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: 200406/117 X-Sequence-Number: 7175 Jean-Luc Lachance writes: > If the two statments are functionally equivalent, why can't PG rewrite > the "NOT IN" version into the more efficient "NOT EXISTS"? They're not equivalent. In particular, the behavior in the presence of NULLs is quite different. regards, tom lane