sql server - Comparision between A select statement and Multiple select statment that act as batch -
I have a stored procedure that contains a few selected statements that return union results from them.
I'd like to do than to choose a selection rather than an execution plan from them (SP and a select statement).
The problem is that when it is run twe statement (SP and select) the SELECT statement plan their execution in SP. I have an execution plan of SP as a unit.
I have another question. Think of the execution plan attached to this post. The cost of execution plan for all statements should be 100%?
But the amount of all the statements in this execution plan should not be 100%?
Thanks
>
If you have two logic If you are trying to compare versions, then with these lines of script:
Exec < StoredProc & gt; & Lt; Data & gt; Select & lt; Tables & gt; From will allow you to do this. Yes, the execution plan will show you all the questions inside the stored proc. Find out the plan for SP queries if they have a total cost and gt; 50% then SP performed better.
As a side note, if your SP takes parameters, make sure that you compare performance plans in a range of parameter values.
Comments
Post a Comment