Timeline for In SQL Server, if I have two otherwise identical stored procedures with different names, will they use the same execution plan?
Current License: CC BY-SA 4.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 26, 2023 at 16:49 | comment | added | CB_Ron | @ErikDarling I saved that video to watch later. Thanks, I appreciated you sharing it. | |
Sep 26, 2023 at 0:02 | comment | added | J.D. | @CB_Ron FWIW, you don't necessarily always need to parameterize the entire procedure, rather only the specific query or two that are having statistics issues. It may be a good opportunity to refactor the other parts of this complex procedure too, since procedures shouldn't be coded to be overly complex. | |
Sep 25, 2023 at 22:48 | comment | added | Erik Reasonable Rates Darling | @CB_Ron take a look at the video I posted. There’s a solution at the end that uses OPTIMIZE FOR dynamically with the parameter value passed in. | |
Sep 25, 2023 at 21:27 | comment | added | CB_Ron | While this technique looks excellent, and I will in fact be using it in some situations, this particular SP is way too complex to rewrite in this fashion. | |
Sep 25, 2023 at 21:07 | history | answered | Erik Reasonable Rates Darling | CC BY-SA 4.0 |