Re: Why the planner is not using the INDEX .
От
David Gagnon
Тема
Re: Why the planner is not using the INDEX .
Дата
Msg-id
42CAC937.4080702@siunik.com
Ответ на
Re: Why the planner is not using the INDEX . (Tom Lane)
Список
Дерево обсуждения
ported application having performance issues John Mendenhall <john@surfutopia.net>
Re: ported application having performance issues Tom Lane <tgl@sss.pgh.pa.us>
Re: ported application having performance issues "Joshua D. Drake" <jd@commandprompt.com>
Re: ported application having performance issues John Mendenhall <john@surfutopia.net>
Why the planner is not using the INDEX . David Gagnon <dgagnon@siunik.com>
Re: Why the planner is not using the INDEX . Stephan Szabo <sszabo@megazone.bigpanda.com>
Re: Why the planner is not using the INDEX . David Gagnon <dgagnon@siunik.com>
Re: Why the planner is not using the INDEX . Stephan Szabo <sszabo@megazone.bigpanda.com>
Re: Why the planner is not using the INDEX . Bruno Wolff III <bruno@wolff.to>
Re: Why the planner is not using the INDEX . Christopher Kings-Lynne <chriskl@familyhealth.com.au>
Re: Why the planner is not using the INDEX . Tom Lane <tgl@sss.pgh.pa.us>
Re: Why the planner is not using the INDEX . David Gagnon <dgagnon@siunik.com>
Re: Why the planner is not using the INDEX . Enrico Weigelt <weigelt@metux.de>
Re: ported application having performance issues Dennis Bjorklund <db@zigo.dhs.org>
Re: ported application having performance issues John Mendenhall <john@surfutopia.net>
Tom Lane wrote:
>David Gagnon 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
>
>
>
I already tried this construct. But the statement comes from a stored
procedure where the {1000, 2000} is an array variable (requestIds). I
tried to use
IT.ITIRNUM IN (requestIds) or several other variant without success.
Is there a way to make it work? Here is the statement the statement from the store procedure. Remenber requestIds is an array of int.
FOR inventoryTransaction IN
SELECT DISTINCT IRNUM, IRAENUM, IRSTATUT, IRSENS, IRSOURCE,
IRDATE, IRQTE
FROM IR
WHERE IRNUM = ANY (requestIds) and IRYPNUM = companyId
LOOP
Thank for your help !!!!
/David
В списке pgsql-performance по дате отправления