patternsqlMajor
sp_WhoIsActive and get_plans -- Actual Plan?
Viewed 0 times
get_plansactualsp_whoisactiveplanand
Problem
Does Adam Machanic's sp_WhoIsActive return the actual query plan or the estimated plan when run with
@get_plans=1 ?Solution
The tool grabs the plan that is being run at that time. From an email response from Adam:
"Actual plan" usually refers to the query plan that has the actual row counts, number of executions of each iterator, etc. Who is Active cannot return that version of the plan. But the plan it returns is indeed the "actual" plan that's running at the time -- in other words, the plan will not be recompiled into some other plan by the time Who is Active can get it.
Documentation on the same by Adam on sp_whoisactive documentation
"Actual plan" usually refers to the query plan that has the actual row counts, number of executions of each iterator, etc. Who is Active cannot return that version of the plan. But the plan it returns is indeed the "actual" plan that's running at the time -- in other words, the plan will not be recompiled into some other plan by the time Who is Active can get it.
Documentation on the same by Adam on sp_whoisactive documentation
Context
StackExchange Database Administrators Q#1919, answer score: 20
Revisions (0)
No revisions yet.