Re: Optimize query: time of "single * IN(many)" > time - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Optimize query: time of "single * IN(many)" > time
Date
Msg-id 20040108114427.GB753@dcc.uchile.cl
Whole thread Raw
In response to Re: Optimize query: time of "single * IN(many)" > time  (Dave Smith <dave.smith@candata.com>)
List pgsql-general
On Thu, Jan 08, 2004 at 06:28:14AM -0500, Dave Smith wrote:
> Firstly you should always provide an explain from your query before
> posting to this list.

You mean "while posting", because he can't possible provide the explain
before having the means to do so, can he? :-)

> I think the problem is that in <7.4 PG did not use
> indexes for IN queries. This has been fixed in 7.4.

I think what was done is to optimize queries like IN (SELECT ...) but
there has not been improvement for IN (1,2,3, ... 550) like he
appears to be doing.

Maybe something to try is putting the IDs in a (temp?) table and using
the first form.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Cada quien es cada cual y baja las escaleras como quiere" (JMSerrat)

pgsql-general by date:

Previous
From: Dave Smith
Date:
Subject: Re: Optimize query: time of "single * IN(many)" > time
Next
From: Travel Jadoo
Date:
Subject: order by is ambiguous