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
0 comments:
Post a Comment