HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Measure compilation time of stored procedure

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
storedcompilationtimeproceduremeasure

Problem

I need to measure how much time it takes for the MSSQL-2012 to compile a stored procedure.

Is it possible?

Solution

Yes, you can get this information. It is buried inside properties of the select statement in an actual execution plan. To do that:

  • Set Actual Execution plan to on



  • Execute your SP with recompile option



  • Go to Actual Execution plan, choose 'select' part



  • Go to properties (Press F4) and there you can see CompileTime



However, I'm not sure how accurate or what measures this information displays.

I am assuming, you want to discover how much it does affect your performance. You can search this article for 'compile time' https://technet.microsoft.com/en-us/library/cc966540.aspx

Context

StackExchange Database Administrators Q#130781, answer score: 6

Revisions (0)

No revisions yet.