O'Reilly logo

Microsoft SQL Server 2012 Performance Tuning Cookbook by Bihag Thaker, Ritesh Shah

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Improving query performance by not using functions on predicate columns

Using a scalar function with column name in predicate would again make your condition non-sargable. It is really a heavy load on the query optimizer and consumes lot of resources. For as long as possible, try to use the alternate method and avoid using functions with column name in predicate, to achieve performance boosts from the indexes.

Getting ready

There is no automatic way to find this behavior; this is simply a manual process. You either keep this step in mind while developing the SQL script or while working on performance tuning projects.

How to do it...

There will be two different examples here, in this recipe. The first example will use the DATE function in predicate, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required