Thread: Performance of request of type WHERE ... IN ( ... )

Performance of request of type WHERE ... IN ( ... )

From
"Th Templ"
Date:
Hello,

I have performance problem of an request of type ... WHERE ... IN ( ... ).
How to improve performance of this type of request when a group of id in the 
'in' is important.
Thanks for your answers.
Templth


_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail



Re: Performance of request of type WHERE ... IN ( ... )

From
Achilleus Mantzios
Date:
On Wed, 15 Jan 2003, Th Templ wrote:

> Hello,
>
> I have performance problem of an request of type ... WHERE ... IN ( ... ).
> How to improve performance of this type of request when a group of id in the
> 'in' is important.

Try WHERE ... EXISTS (...).


> Thanks for your answers.
> Templth
>
>
> _________________________________________________________________
> Add photos to your e-mail with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>

==================================================================
Achilleus Mantzios
S/W Engineer
IT dept
Dynacom Tankers Mngmt
Nikis 4, Glyfada
Athens 16610
Greece
tel:    +30-10-8981112
fax:    +30-10-8981877
email:  achill@matrix.gatewaynet.com       mantzios@softlab.ece.ntua.gr



Re: Performance of request of type WHERE ... IN ( ... )

From
"Josh Berkus"
Date:
Th,

> > I have performance problem of an request of type ... WHERE ... IN (
> ... ).
> > How to improve performance of this type of request when a group of
> id in the
> > 'in' is important.
> 
> Try WHERE ... EXISTS (...).

The explanation of the difference btw. IN and EXISTS is in the
PostgreSQL FAQ on the web site.

-Josh