UPDATE: this was drafted long ago, but couldn’t really got to post it till now. You might find this post a bit old, BUT it’s quite relevant even now and extremely informative post.
I came across this gem of an article which lists out 7 things that affect T-SQL performance.
I do not want to take anything out from that article and post it here, as you would realize by reading the original post, you would learn some very important concepts.
Read it here: The Seven Sins Against T-SQL Performance.