1

As said above
For instance WHERE In(var 1,var 2,var 3, ..., var 5609,)

Any limits before it slows the machine down ?

Matthew Flaschen
  • 278,309
  • 50
  • 514
  • 539
Matt
  • 13
  • 1
  • 3

6 Answers6

3

I would say that if you have to ask then you're probably doing something wrong. :)

Rich Schuler
  • 41,814
  • 6
  • 72
  • 59
2

I don't believe there is a limit to the number of values in the list of the IN clause in MySQL, unlike the 1000 Oracle limit. I would verify this though by writing some sort of loop to build a really long 'IN' statement if you had a concern. Also, someone else asked this question and there wasn't a known limit.

Community
  • 1
  • 1
bkaid
  • 51,465
  • 22
  • 112
  • 128
1

Oracle 9i Maximum number of expressions in a list is 1000;

KMån
  • 9,896
  • 2
  • 31
  • 41
1

In Oracle (Verified only in 10g) it is 1000.

ORA-01795: maximum number of expressions in a list is 1000

Sujee
  • 4,985
  • 6
  • 31
  • 37
0

With "limits", are you referring to a limitation in the the implementation, or something that will slow the query down? If it's the latter, the best answer is test it yourself.

Evan Trimboli
  • 29,900
  • 6
  • 45
  • 66
  • Sorry for being vague. I am just asking if a few thousand numbers inside the in statement is too much and will bring the server to a halt :) – Matt Jun 21 '10 at 04:55
  • 2
    You could possibly try inserting that data into a temp table first. – Matt Mitchell Jun 21 '10 at 04:59
0

MS SQL Server chokes at around 2000, MS SQL Compact has no limits (or I have not reached it yet, more than 2500).

Note: these are limits on parameters for queries.

leppie
  • 115,091
  • 17
  • 196
  • 297