-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Fixed a bug in the performance counter query #3175
Conversation
@zensqlmonitor Can you review? |
@m82labs, I have SQL Server 2016 SP1 CU3 installed and I can't see any duplicate values... |
@zensqlmonitor running this across my 300+ instances:
Results in 64 instances returning duplicates. The duplicates are isolated to a few of the XTP counters. We use Hekaton on all instances, so it doesn't seem to be related to usage patterns or anything. Running this on a single instance:
Results in this output:
These are boxes that may have started their lives as SQL Server 2014, then went to SQL 2016 CTP and then upgraded and patched several times to get to the latest CU on SP1. It is quite possible this might be a hold-over from one of the CTPs or something. I should note as well that this is happening on CU2 and CU3 for me. |
@zensqlmonitor as a test, I reloaded perfmon counters on one of the boxes and the duplicates remain. the |
@m82labs Can you rebase, I think you will need to do an interactive rebase and remove the commits that are not part of your changes. |
…ver 2016 SP1-CU2. The performance counter DMV contains duplicate entries which are not handled by the query.
@danielnelson done, it should be good now. |
(cherry picked from commit 1c5ebd4)
When running the performance counter query against SQL Server 2016 SP1-CU2, you will see PK errors when inserting the performance counters into the temp table. The performance counter DMV contains duplicate entries which are not handled by the query. Adding
DISTINCT
to the queries retrieving the results will resolve this issue.I also tried setting the PK on the temp tables to ignore duplicate keys, but the distinct was marginally cheaper on my system, and likely more backwards compatible.
Required for all PRs: