pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: Anne Rosset <arosset@collab.net>
Cc: Craig James <craig_james@emolecules.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Need to increase performance of a query
Date: Thu, 10 Jun 2010 13:10:02 -0700
Message-ID: <4C11469A.8000706@joeconway.com> (raw)
In-Reply-To: <4C114381.3030900@collab.net>
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>

On 06/10/2010 12:56 PM, Anne Rosset wrote:
> Craig James wrote:
>>   create index item_rank_null_idx on item_rank(pf_id)
>>    where item_rank.pf_id is null;
>>
>> Craig
>>
> Hi Craig,
> I tried again after adding your suggested index but I didn't see any
> improvements: (seems that the index is not used)

>                 Filter: ((rank IS NOT NULL) AND (pf_id IS NULL) AND
> ((project_id)::text = 'proj2783'::text))
> Total runtime: 11.988 ms
> (6 rows)
> 
> Time: 13.654 ms

try:

create index item_rank_null_idx on item_rank(pf_id)
where rank IS NOT NULL AND pf_id IS NULL;

Joe

Attachments:

  signature.asc (application/pgp-signature, 898B) download

view thread (20+ messages)  latest in thread

Message-ID: <4C11469A.8000706@joeconway.com>
Permalink:  ../4C11469A.8000706@joeconway.com/
Also on:    postgresql.org/message-id/4C11469A.8000706@joeconway.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: mail@joeconway.com, arosset@collab.net, craig_james@emolecules.com
  Subject: Re: Need to increase performance of a query
  In-Reply-To: <4C11469A.8000706@joeconway.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox