Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defaults for @RetainForcedMetrics and @CleanStatsOnly are not correctly configured in the code #37

Open
DatabaseJase opened this issue Aug 1, 2024 · 0 comments

Comments

@DatabaseJase
Copy link

DatabaseJase commented Aug 1, 2024

Hello,

The notes in the QDSCacheCleanup stored procedure states that the are the defaults for these parameters are:

-- @RetainForcedMetrics BIT -- Flag to retain metrics for queries having forced plans (provided they are not orphan queries) [Default: 0]
-- @CleanStatsOnly BIT -- Changes the behavior of the clean process so only the stats will be cleaned, but not the plans, queries and queries' texts. [Default: 0]

The stored procedure then declares the variables as 1 meaning that the default is not implemented correctly:

,@RetainForcedMetrics BIT = 1
,@CleanStatsOnly BIT = 1

This took me a while to hunt down as I could not understand why the sp_query_store_reset_exec_stats process was being called.

I suggest that the default should stay declared as 1 and change the comments, this prevents current user base from experiencing unexpected changes in behaviour, but I'll leave that with you to decide since I have overriden the defaults by specifying the value when executing QDSCacheCleanup.

Regards

Jason

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant