Maximum number of items for query with IN operator

Maximum number of items for query with IN operator

Post by David Tucke » Thu, 18 Oct 2001 06:20:19



What is the maximum number of items in a query using the IN operator.  Such
as:

Select * from customer where name IN ('David','Steve')...

Thanks,
David

 
 
 

Maximum number of items for query with IN operator

Post by Zachary Well » Thu, 18 Oct 2001 06:28:58


This was asked a while back. I believe the consensus was that you're more
limited by other restrictions (such as batch size) than you are by limits on
IN. In other words, there is no real limit. You may want to server the NG to
find the thread. I think it was about 2 weeks ago.

Zach


Quote:> What is the maximum number of items in a query using the IN operator.
Such
> as:

> Select * from customer where name IN ('David','Steve')...

> Thanks,
> David


 
 
 

Maximum number of items for query with IN operator

Post by lindawi » Thu, 18 Oct 2001 14:16:59


David,

According to the maximum capacity specifications in Books Online, the Batch
size limit is 65,536 * network packet size (default packet size is 4096
bytes). You may find that you have performance problems long before you
reach that limit.

I wouldn't try to work with more than a few items using IN (...).  You could
try putting all items in a temp table and then joining to that in your
query. You can have as many items as you want in your table.

Linda


Quote:> What is the maximum number of items in a query using the IN operator.
Such
> as:

> Select * from customer where name IN ('David','Steve')...

> Thanks,
> David