Subscribe To

Subscribe to SQL Server and XML by Email

Tuesday, May 22, 2007

Writing faster TSQL

One of the programming tasks that interests me most is the optimization part. It is a pain and joy to have a piece of code running faster than it was. It is a pain because the efforts needed to get the task done are much more than one would expect. I have seen people asking: "Hey, this query takes 20 seconds. Please make sure that it runs in 2 seconds. I need it by the evening, please". It is a joy, because, most people would love to see things working exactly as we expect and wanted.

Optimizing a piece of code for performance includes walking through each line and compare the performance factors of each line of code. These performance factors needs to be compared with alternate syntaxes which provides the same result. However, what is most important is the understanding of the engine which executes your code. If you understand how the engine does the work, then you can write instructions in a way that the engine would be able to perform better.

I have started writing a new series of articles at SQL Server Central which would concentrate on providing various hints to write faster TSQL code. The first article in this series is available here


Post a Comment

About Me
Jacob Sebastian
* XQuery Tutorials
My Links
SQL Server White Papers
SQL Server 2008
My Articles
XML Workshop RSS Feed
Contact me
Free Hit Counter
Web Site Hit Counters
SQL Server Bloggers
Blog Directories
blogarama - the blog directory Programming Blogs - BlogCatalog Blog Directory
Copyright Jacob Sebastian