Fix various places in PerfStatsAnalysis.sql - minor issues#489
Fix various places in PerfStatsAnalysis.sql - minor issues#489
Conversation
There was a problem hiding this comment.
Pull request overview
This PR applies a set of small correctness and robustness fixes to PerfStatsAnalysis.sql, primarily around wait stats calculations and a few stored-procedure logic issues.
Changes:
- Harden wait stats outputs (e.g., clamp negative wait deltas; exclude zero/negative waits from “top” category selection; use
BIGINTfor available CPU seconds). - Fix query logic issues (e.g., correct boolean grouping in blocking-chain time filtering; fix cursor loop condition).
- Prevent runtime errors / logic inversions (e.g.,
NULLIFto avoid divide-by-zero; correctCOL_LENGTHnull check; remove stray debugSELECT).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot apply changes based on the comments in this thread |
Agent-Logs-Url: https://github.com/microsoft/SqlNexus/sessions/4bf32a8d-734c-42b4-98c1-d14f2f6ad6e8 Co-authored-by: PiJoCoder <23519517+PiJoCoder@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/SqlNexus/sessions/20c9b77f-b44d-41f2-8830-d9fcd5ddc2e5 Co-authored-by: PiJoCoder <23519517+PiJoCoder@users.noreply.github.com>
Applied in commit 9e57bde — updated the |
|
@copilot: can you summarize and update the description in the PR of all the changes/commits in this PR |
Updated the PR description with a full summary of all changes across the three commits. Here's the breakdown: Wait stats hardening
Query logic fixes
Runtime error / logic-inversion fixes
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -4855,7 +4873,7 @@ DECLARE @FileName NVARCHAR(MAX), | |||
| @SqlStmt VARCHAR(MAX); | |||
|
|
|||
| --if xml_plan column is in the table, the the file name (only) of the file that contains the query plan with optimized batch sort | |||
There was a problem hiding this comment.
Typo in comment: duplicated word "the" ("the the").
| --if xml_plan column is in the table, the the file name (only) of the file that contains the query plan with optimized batch sort | |
| --if xml_plan column is in the table, the file name (only) of the file that contains the query plan with optimized batch sort |
This PR applies a set of small correctness and robustness fixes to
PerfStatsAnalysis.sql, primarily around wait stats calculations and a few stored-procedure logic issues.Changes:
BIGINTfor available CPU seconds).NULLIFto avoid divide-by-zero; correctCOL_LENGTHnull check; remove stray debugSELECT).