Skip to content

#476 Fix: blocking_end reported incorrectly due to incomplete runtime…#512

Merged
PiJoCoder merged 4 commits intomasterfrom
hacitandogan_260427_wrongBlockingDuration
May 5, 2026
Merged

#476 Fix: blocking_end reported incorrectly due to incomplete runtime…#512
PiJoCoder merged 4 commits intomasterfrom
hacitandogan_260427_wrongBlockingDuration

Conversation

@hacitandogan
Copy link
Copy Markdown
Contributor

… data

The tbl_PERF_STATS_SCRIPT_RUNTIMES table was populated only from tbl_OS_WAIT_STATS before the blocking chain analysis ran, causing MAX(runtime) to be earlier than the actual last data collection snapshot. Runtimes from tbl_REQUESTS and tbl_NOTABLEACTIVEQUERIES are now inserted into tbl_PERF_STATS_SCRIPT_RUNTIMES before the blocking chain UPDATE executes, ensuring blocking_end reflects the true end of data collection.

… data

The tbl_PERF_STATS_SCRIPT_RUNTIMES table was populated only from tbl_OS_WAIT_STATS before the blocking chain analysis ran, causing MAX(runtime) to be earlier than the actual last data collection snapshot. Runtimes from tbl_REQUESTS and tbl_NOTABLEACTIVEQUERIES are now inserted into tbl_PERF_STATS_SCRIPT_RUNTIMES before the blocking chain UPDATE executes, ensuring blocking_end reflects the true end of data collection.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes incorrect blocking_end values in the postmortem blocking-chain analysis by ensuring tbl_PERF_STATS_SCRIPT_RUNTIMES includes runtimes from additional source tables before the end-of-collection update runs.

Changes:

  • Insert distinct runtime values from tbl_REQUESTS and tbl_NOTABLEACTIVEQUERIES into dbo.tbl_PERF_STATS_SCRIPT_RUNTIMES prior to the blocking-chain blocking_end update.
  • Update the expected SHA256 hash for PerfStatsAnalysis.sql in the script integrity allowlist.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
sqlnexus/ScriptIntegrity.cs Updates the stored hash for PerfStatsAnalysis.sql to match the modified script content.
sqlnexus/PerfStatsAnalysis.sql Inserts additional runtimes before blocking-chain end-time correction so MAX(runtime) reflects the true end of collection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sqlnexus/PerfStatsAnalysis.sql Outdated
Comment thread sqlnexus/PerfStatsAnalysis.sql Outdated
Comment thread sqlnexus/PerfStatsAnalysis.sql Outdated
Comment thread sqlnexus/PerfStatsAnalysis.sql Outdated
@PiJoCoder PiJoCoder linked an issue Apr 27, 2026 that may be closed by this pull request
@PiJoCoder PiJoCoder force-pushed the hacitandogan_260427_wrongBlockingDuration branch from bd8f7e4 to 0485311 Compare April 30, 2026 19:53
PiJoCoder
PiJoCoder previously approved these changes Apr 30, 2026
…acitandogan_260427_wrongBlockingDuration
PiJoCoder
PiJoCoder previously approved these changes Apr 30, 2026
@PiJoCoder PiJoCoder enabled auto-merge (squash) April 30, 2026 20:06
Copy link
Copy Markdown
Contributor

@asavioliMSFT asavioliMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

memory scenario import fails on this PR with error below. confirmed it works on public version

SQLNexus Information: 0 : Rowset Importer failed for file: xxxxxxxxx_SQL_Server_Mem_Stats.outexception: RowsetImportEngine.RowsetImportException: RowsetImport failed. ---> System.ArgumentException: Unsafe column name.
at RowsetImportEngine.TextRowsetImporter.CreateTable() in C:\GitHub\SqlNexus\RowsetImportEngine\TextRowsetImporter.cs:line 391
--- End of inner exception stack trace ---

@PiJoCoder PiJoCoder merged commit 2c5f47d into master May 5, 2026
3 checks passed
@PiJoCoder PiJoCoder deleted the hacitandogan_260427_wrongBlockingDuration branch May 5, 2026 17:15
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

Successfully merging this pull request may close these issues.

View vw_BLOCKING_CHAINS is reporting wrong blocking duration

4 participants