Re: Need to increase performance of a query

From: Joe Conway <mail(at)joeconway(dot)com>
To: Anne Rosset <arosset(at)collab(dot)net>
Cc: Craig James <craig_james(at)emolecules(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Need to increase performance of a query
Date: 2010-06-10 20:10:02
Message-ID: 4C11469A.8000706@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Joe Conway 2010-06-10 20:13:46 Re: Need to increase performance of a query
Previous Message Anne Rosset 2010-06-10 20:08:27 Re: Need to increase performance of a query