开发者

Is MySQL performant with select ... in (ID1,ID2,ID3,...ID100)?

Will this kind of query bring performance开发者_如何转开发 issue?


Assuming you have an index on whatever field you are doing the IN on, you should be fine.


Any query will cause performance issues (to some degree, technically). The question is not whether it will cause performance issues, the question is whether it's necessary.


Versus what? As long as your WHERE clause values are indexed appropriately, you should be fine (in general).


Sometimes yes, but sometimes this syntax is also necessary or better than any alternative you might have to achieve the same result set. In order to fully say that in your case the performance will be worse than it would be with a differently written query, we would need to know your exact query and database schema.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜