开发者

Best way to select all records

Does anyone know a performance or any other benefit of using select(1) or select(*) over the other? I am looking to optimiz开发者_运维技巧e searching


There are some instances it makes a difference...The best thing to do is to look at the execution plan for your query using SELECT (1) and SELECT (*)

This post is also a good resource: http://blog.sqlauthority.com/2008/02/26/sql-server-select-1-vs-select-an-interesting-observation/


select 1 will transmit less data, so technically it's faster. Not sure how useful it is though.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜