Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id E0D6E6425B0 for ; Thu, 10 Jun 2010 17:08:36 -0300 (ADT) 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 58973-05 for ; Thu, 10 Jun 2010 20:08:29 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sp-exchfea.sp.corp.collab.net (sp-exchfea.sp.corp.collab.net [204.16.106.198]) by mail.postgresql.org (Postfix) with ESMTP id A5F0364164D for ; Thu, 10 Jun 2010 17:08:29 -0300 (ADT) Received: from [204.11.125.143] ([204.11.125.143]) by sp-exchfea.sp.corp.collab.net with Microsoft SMTPSVC(6.0.3790.3959); Thu, 10 Jun 2010 13:08:27 -0700 Message-ID: <4C11463B.7080608@collab.net> Date: Thu, 10 Jun 2010 13:08:27 -0700 From: Anne Rosset User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Heikki Linnakangas CC: Craig James , pgsql-performance@postgresql.org Subject: Re: Need to increase performance of a query References: <4C1125F0.8090101@collab.net> <4C112B19.6080908@krogh.cc> <4C113098.5040105@collab.net> <98414706.20100610212211@erwied.eu> <4C113E2F.6000305@collab.net> <4C11413B.8080107@emolecules.com> <4C11439C.3010603@enterprisedb.com> In-Reply-To: <4C11439C.3010603@enterprisedb.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 10 Jun 2010 20:08:27.0641 (UTC) FILETIME=[B071FE90:01CB08D8] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.51 tagged_above=-10 required=5 tests=BAYES_05=-0.5, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201006/185 X-Sequence-Number: 39041 Heikki Linnakangas wrote: > On 10/06/10 22:47, Craig James wrote: >> Postgres normally doesn't index NULL values even if the column is >> indexed, so it has to do a table scan when your query includes an IS >> NULL condition. > > That was addressed in version 8.3. 8.3 and upwards can use an index > for IS NULL. > > I believe the NULLs were stored in the index in earlier releases too, > they just couldn't be searched for. > I am using postgres 8.3.6. So why doesn't it use my index? Thanks, Anne