Skip to content

Improve Health Monitoring service-detail query performance - #781

Merged
StuartFerguson merged 1 commit into
mainfrom
bug/#780_ui_query_performance
Sep 25, 2026
Merged

StuartFerguson merged 1 commit into
mainfrom
bug/#780_ui_query_performance

Conversation

@StuartFerguson

Copy link
Copy Markdown
Member

Summary

  • Split service-detail observation/check loading to avoid the wide EF join and excessive SQL Server memory grant.
  • Limit materialized detail observations and checks to the latest 100.
  • Keep 24-hour uptime and observation totals accurate with a separate aggregate query.
  • Distinguish loading, not-found, and query-error states in the detail page.
  • Log detail-query failures server-side.
  • Add tests for load states and observation metrics.

Root cause

The staging query plan showed a RESOURCE_SEMAPHORE wait of approximately 93 seconds, a 427 MB desired memory grant, only 1 MB granted, and tempdb sort spills while loading roughly 1,400 observations and checks through one wide Include query.

Verification

  • Health Monitoring tests: 72 passed
  • Release build: 0 warnings, 0 errors

Closes #780

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@StuartFerguson
StuartFerguson merged commit b05380c into main Sep 25, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Health Monitoring service-detail query performance

1 participant