-
Notifications
You must be signed in to change notification settings - Fork 182
Description
Is your feature request related to a problem? Please describe.
I'm always frustrated when I'm handed some hideously un-parameterised query and asked to performance tune it. With EXEC sp_QuickieStore @QueryTextSearch = 'whatever never changed', @top = 100, I'll get an overwhelming amount of data and no doubt discover that somebody has embedded a run time value right in the query.
No worries, I foolishly think: I can just grab the plan hash in each row and get some idea of how many different plans I'm dealing with. Once I have that, I can pick apart which plans are fast and which are slow. Hopefully, there are only a handful of morally distinct plans. Unfortunately, this scheme fails. sp_QuickieStore is very coy with the plan hashes. It only shows them under a very limited set of circumstances:
CASE
WHEN @include_plan_hashes IS NOT NULL
OR @ignore_plan_hashes IS NOT NULL
OR @sort_order = 'plan count by hashes'
THEN N'
qsp.query_plan_hash,'
ELSE N''
END +Even Expert Mode is not sufficient! To get the plan hashes in the sp_QuickieStore output, I need to query the Query Store views to get the hashes and then run sp_QuickieStore @include_plan_hashes = '...'. This is rather painful!
Describe the solution you'd like
Just throw OR @Expert_Mode = 1 into the text I've given above and that's job done.
Describe alternatives you've considered
This is pretty similar to what made me add the "plan count by hashes" sort order. I could probably use that sort order and then do the hard work in Excel.
Are you ready to build the code for the feature?
As much as we'd love to build everything that everyone wants for free, we need your help. Open source is built with your help and code. Are you ready to commit time to this project? Have you got existing code you can help contribute to solve the problem?
It should just be one line?
IMPORTANT: If you're going to contribute code, please read the contributing guide first.
https://github.com/erikdarlingdata/DarlingData/blob/main/CONTRIBUTING.md
Sure.