Re: Why the planner is not using the INDEX .

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Gagnon <dgagnon(at)siunik(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Why the planner is not using the INDEX .
Date: 2005-07-05 16:09:56
Message-ID: 23492.1120579796@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

David Gagnon <dgagnon(at)siunik(dot)com> writes:
> explain analyse SELECT IRNUM FROM IR
> INNER JOIN IT ON IT.ITIRNUM = ANY ('{1000, 2000}') AND
> IT.ITYPNUM = 'M' AND IR.IRYPNUM = IT.ITYPNUM AND IR.IRNUM = IT.ITIRNUM
> WHERE IRNUM = ANY ('{1000, 2000}') and IRYPNUM = 'M'

Those =ANY constructs are not currently optimizable at all. You might
get better results with "IT.ITIRNUM IN (1000, 2000)" etc.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Alexander Stanier 2005-07-05 16:13:42 Heavy virtual memory usage on production system
Previous Message Stephan Szabo 2005-07-05 14:02:07 Re: Why the planner is not using the INDEX .