开发者

MySQL IN condition limit

Hey, I have to use IN condition i开发者_如何学JAVAn my MySQL statement with a large set of ids.

Example

SELECT * FROM users WHERE id IN (1,2,3,4...100000)

Is there a limit if items the IN statement can have?


No there isn't, check the manual about the IN function:

The number of values in the IN list is only limited by the max_allowed_packet value.


As far as I know in mysql, there is no limit for items in the IN statement.

In oracle altough, there is a limit of 1000 items in the IN statement.

But more the items in IN, your query performance will slow down unless that column is indexed.


MySQL IN condition limit

1073741824 This is the limit given in Mysql docs

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜