Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 9E6A383DC06 for ; Sun, 18 Dec 2011 16:19:25 -0400 (AST) Received: from mail6.webfaction.com ([74.55.86.74] helo=smtp.webfaction.com) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RcNCd-0007v9-Qu for pgsql-performance@postgresql.org; Sun, 18 Dec 2011 20:19:25 +0000 Received: from [192.168.1.113] (pool-72-66-73-96.washdc.fios.verizon.net [72.66.73.96]) by smtp.webfaction.com (Postfix) with ESMTP id A3D94207BADE for ; Sun, 18 Dec 2011 14:19:09 -0600 (CST) Message-ID: <4EEE4AA9.6000406@tara-lu.com> Date: Sun, 18 Dec 2011 15:18:49 -0500 From: Roxanne Reid-Bennett User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: will the planner ever use an index when the condition is <> ? References: <4EECB57F.3050208@tara-lu.com> <4EEDFE1E.9070303@tara-lu.com> <3088.1324233086@sss.pgh.pa.us> In-Reply-To: <3088.1324233086@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201112/131 X-Sequence-Number: 45930 On 12/18/2011 1:31 PM, Tom Lane wrote: > If you have a specific case where that's not true, you might consider > a partial index (CREATE INDEX ... WHERE x <> constant). But the > details of that would depend a lot on the queries you're concerned > about. regards, tom lane Which I had tried in the form of (st_geometrytype(location) <> 'ST_Point'::text)... planner never picked it (for the scenario given before). But this thread was all pretty much .. design/plan/future use. This specific instance I've handled with in ("ST_Polygon","ST_MultiPolygon"). Thank you for the feedback. Roxanne