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

Monitoring performance of a query by SET STATISTICS TIME

SET STATISTICS TIME is also one of the light weight weapons which can be used to get some of the important information regarding CPU resources consumed by the batch we have executed.

Getting ready

In order to know the real CPU usage statistics of the query you execute, we will use the same SELECT query that we have used in the previous recipe Monitoring performance of query by SET STATISTICS IO by adding SET STATISTICS TIME.

After comparing the different execution plan, check the statistics IO of the query, it is now time for further digging by looking at CPU resources consumed by query or batch which displays the number of milliseconds required by the CPU to parse, compile, and execute query ...

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