Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id A6A3B6441DD for ; Thu, 10 Jun 2010 18:20:31 -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 54235-02 for ; Thu, 10 Jun 2010 21:20:21 +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 E4112644174 for ; Thu, 10 Jun 2010 18:20:20 -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 14:20:18 -0700 Message-ID: <4C11570F.9050209@collab.net> Date: Thu, 10 Jun 2010 14:20:15 -0700 From: Anne Rosset User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Joe Conway 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> <4C114381.3030900@collab.net> <4C11469A.8000706@joeconway.com> <4C11477A.5020909@joeconway.com> <4C114958.4080308@collab.net> <4C1153D0.5060806@joeconway.com> In-Reply-To: <4C1153D0.5060806@joeconway.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 10 Jun 2010 21:20:18.0859 (UTC) FILETIME=[BA21A7B0:01CB08E2] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.011 tagged_above=-10 required=5 tests=BAYES_20=-0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201006/192 X-Sequence-Number: 39048 Joe Conway wrote: > On 06/10/2010 01:21 PM, Anne Rosset wrote: > >>> >>> >> I tried that and it didn't make any difference. Same query plan. >> > > A little experimentation suggests this might work: > > create index item_rank_project on item_rank(project_id, rank) where > pf_id IS NULL; > > Joe > > Yes it does. Thanks a lot! Anne