Lazy-load server tabs and cap query grid results to TOP 500#852
Merged
erikdarlingdata merged 2 commits intodevfrom Apr 16, 2026
Merged
Lazy-load server tabs and cap query grid results to TOP 500#852erikdarlingdata merged 2 commits intodevfrom
erikdarlingdata merged 2 commits intodevfrom
Conversation
…rst visit Initial tab open and Refresh button now only load the currently visible tab. First switch to any tab triggers a full refresh of that tab (all sub-tabs). Subsequent refreshes only hit the active sub-tab. Ctrl+Click on Refresh Tab (or Ctrl+F5) refreshes all tabs at once. Apply to All Tabs retains existing full-refresh behavior. Fixes #835 — prevents heavy queries (e.g. GetQueryStatsAsync) from running on tab open when the user is only viewing Overview. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
GetQueryStatsAsync, GetProcedureStatsAsync, and GetQueryStoreDataAsync were returning unbounded result sets. With 49 databases and 742K rows in query_stats over 3 days, the GROUP BY with plan XML could produce thousands of rows and timeout after 120 seconds. TOP 500 ordered by avg CPU desc is plenty for a grid view and prevents the query from consuming unbounded memory on large installations. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GetQueryStatsAsyncfrom running when the user just wants Overview.GetQueryStatsAsync,GetProcedureStatsAsync, andGetQueryStoreDataAsyncnow return at most 500 rows (ordered by avg CPU desc). Prevents unbounded memory consumption on large installations.Fixes #835 — tested against a report from a user with 49 databases and 742K rows in
query_statsafter 3 days, where the queries were timing out after 120 seconds and consuming 4GB+ memory.Test plan
🤖 Generated with Claude Code