In the system I am developing, I have a choice either using one stored procedure that performs three related tasks and does not return either the result or the same set of results, but is obtained from two different tables.
I read an article yesterday suggesting that a stored procedure should have only one execution plan and that any procedure that changes its execution plan depending on the difference in parameters should probably be written as several procedures.
Writing a procedure in the form of three different procedures would change how the system performing the procedures works, but not to a large extent.
What I would like to know is whether the performance obtained from procedures that do not have different execution plans, depending on the input data compared to one procedure, is the overhead of calling the database three times as much, than because of the need to recompile the implementation plan, depending on the circumstances?
thanks
Greg
source share