Reputation: 7467
Does the order in which parameters are passed to a stored procedure affect the caching of query plans, or cause any other sort of extra processing overhead?
My theory is "no" for the query plans, and any processing overhead required to re-order the parameters is negligible, but I'd like to find some information to back it up.
Upvotes: 1
Views: 175
Reputation: 332691
No, order of parameters does not matter. The value is what matters.
Mind that SQL Server is susceptible to parameter sniffing.
Upvotes: 1
Reputation: 432511
There is no effect at all. I have no proof, because anything about this concentrates on the compilation, statistics, cost optimiser etc...
Also, the parameters would be plugged into a query: any order here would be ignored during the optimisation/compilation process.
Upvotes: 2