[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Query performance ?
- Subject: Re: Query performance ?
- From: Arjan Hoornstra <ahoor@YAHOO.COM>
- Date: Mon, 26 Jun 2000 01:47:19 -0700
I would prefer to insert your 30 values into a
temporary table and use the IN clause for a subquery
to that table.
and prdkey in (select id from ##topsellers)
For static tables my experience is that there is no
difference in performance, the optimiser translates an
IN into OR's.
Arjan
--- Sayre John <John_Sayre@GAP.COM> wrote:
> Does a query with an "in list" in the where clause
> typically perform better than
> a long list of variables?
>
> I am debating sending a dynamic string of product
> keys (the top 30 of n sellers)
> to a query. Have the sales figures, need the
> inventory.
>
> Would "and prdkey in
>
("1","2"..............................................,"30")"
> perform better
> (or worse)
> than "and (prdkey = "1" or prdkey= "2" ...........
> or prdkey = "30") "
>
> Thanks!
__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/