X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 13A828B9D0C for ; Tue, 1 Feb 2005 03:37:22 +0000 (GMT) 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 95541-02 for ; Tue, 1 Feb 2005 03:37:12 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 525D28B9CFB for ; Tue, 1 Feb 2005 03:37:15 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j113b5iu009325; Mon, 31 Jan 2005 22:37:06 -0500 (EST) To: Don Drake Cc: Stephan Szabo , pgsql-sql@postgresql.org Subject: Re: plpgsql functions and NULLs In-reply-to: <6c21003b05013118121b464bac@mail.gmail.com> References: <6c21003b0501301141234c256b@mail.gmail.com> <20050131132701.G12960@megazone.bigpanda.com> <6c21003b05013114272504d72e@mail.gmail.com> <20050131162845.K27545@megazone.bigpanda.com> <6c21003b05013118121b464bac@mail.gmail.com> Comments: In-reply-to Don Drake message dated "Mon, 31 Jan 2005 20:12:23 -0600" Date: Mon, 31 Jan 2005 22:37:05 -0500 Message-ID: <9324.1107229025@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/4 X-Sequence-Number: 20115 Don Drake writes: > On Mon, 31 Jan 2005 16:32:02 -0800 (PST), Stephan Szabo > wrote: >> Actually, now that I think about it, I wonder if that's a good thing to >> use because I don't think that'll use indexes to do the search. You may >> want to do some testing to see how it runs for you. > I'm constraining on other columns as well and it's still picking up the index. Stephan is right that an IS DISTINCT FROM construct is not considered indexable. So it's only your other constraints that are being used with the index. You need to think about whether the other constraints are selective enough to yield adequate performance. regards, tom lane