Hi,
In a system I'm developing I have a choice of either using a single stored procedure that does three related jobs and returns either no result, or the same result set, but sourced from two different tables.
I read an article yesterday that suggested that a stored-procedure should only have one execution plan and that any procedure that changes it's execution plan depending on a difference in parameters should probably be written as multiple procedures.
Writing the procedure as three different procedures would change how the system that executes the procedures operates but not in any significant way.
What I'd like to know is whether the performance gained from having procedures that don't have different execution plans depending on inputs vs a single procedure is worth the effort i.e. is the overhead of calling the database three times greater than the overhead of having to recompile the performance plan depending on circumstances?
Thanks
Greg