Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

SQLAndy

I'm Andy Warren, currently a SQL Server trainer with End to End Training. Over the past few years I've been a developer, DBA, and IT Director. I was one of the original founders of SQLServerCentral.com and helped grow that community from zero to about 300k members before deciding to move on to other ventures.

If Exists (Select 1...) vs If Exists (select * ...)

If exists is a well known way to improve performance because it returns as soon as it matches a single row - at that point it knows the condition is true and there is no need to continue.During a recent www.opass.org meeting guest speaker Bill Graziano mentioned that he uses if exists (select 1) instead of if exists (select *) as a performance optimization. Discussion revealed that this was based on a conversation with a MS person at some point, but Bill didn't have online URL to support it. Note that I'm not knocking Bill here, just curious to see if anyone can shed any light on this.

Comments

No comments.

Leave a Comment

Please register or log in to leave a comment.