Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 7BE811337BCC for ; Wed, 20 Apr 2011 10:26:06 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 39992-01 for ; Wed, 20 Apr 2011 13:26:00 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 24D681337BC8 for ; Wed, 20 Apr 2011 10:25:57 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p3KDPvLU025019; Wed, 20 Apr 2011 09:25:57 -0400 (EDT) To: Willy-Bas Loos cc: pgsql-performance@postgresql.org Subject: Re: not using partial index In-reply-to: References: Comments: In-reply-to Willy-Bas Loos message dated "Wed, 20 Apr 2011 10:46:59 +0200" Date: Wed, 20 Apr 2011 09:25:57 -0400 Message-ID: <25018.1303305957@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/280 X-Sequence-Number: 43342 Willy-Bas Loos writes: > [ NOT field1 ISNULL is not seen as equivalent to field1 IS NOT NULL ] > Any ideas why this might be? The planner does not spend an infinite number of cycles on trying to make different expressions look alike. As it happens, 9.1 does know this equivalence, as a byproduct of http://git.postgresql.org/gitweb?p=postgresql.git&a=commitdiff&h=220e45bf325b061b8dbd7451f87cedc07da61706 But I don't consider it a bug that older versions don't do it. regards, tom lane