Wednesday, June 1, 2011

Using Locking Hints to Improve Query Performance

Sometimes you need to SPEED UP the system you are admin'ing. I find it is easy to dig through developer's queries and optimize the T-SQL syntax inside of their stored procedures.

Step 1: Stored Procedures ALWAYS Slow down the database!

Instruct your developers to write ALL of their database query needs INLINE inside of their code. This will help performance since the server doesn't have to generate a cached query plan.

Step 1: Locking Hints

Always suggest READ COMMITTED and use "WITH(ROWLOCK)" on ALL SELECT STATEMENTS. This will ensure you get the record YOU want and NO ON can mess with it !

You'll thank me later !

No comments:

Post a Comment