Re: Why the planner is not using the INDEX . - Mailing list pgsql-performance

From Tom Lane
Subject Re: Why the planner is not using the INDEX .
Date
Msg-id 23492.1120579796@sss.pgh.pa.us
Whole thread Raw
In response to Why the planner is not using the INDEX .  (David Gagnon <dgagnon@siunik.com>)
Responses Re: Why the planner is not using the INDEX .
List pgsql-performance
David Gagnon <dgagnon@siunik.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

pgsql-performance by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Why the planner is not using the INDEX .
Next
From: Alexander Stanier
Date:
Subject: Heavy virtual memory usage on production system