Skip to content

Remove unnecessary query_store_query_text joins in grouped fetches#221

Merged
erikdarlingdata merged 1 commit into
devfrom
fix/querystore-groupby-cleanup
Apr 13, 2026
Merged

Remove unnecessary query_store_query_text joins in grouped fetches#221
erikdarlingdata merged 1 commit into
devfrom
fix/querystore-groupby-cleanup

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

  • Remove unnecessary JOIN sys.query_store_query_text from Step 3 ranked CTEs in both FetchGroupedByQueryHashAsync and FetchGroupedByModuleAsync — the text is already fetched in the Final select
  • Fix qt.query_text_idq.query_text_id in Module Step 3 (column is on sys.query_store_query, no need for the text table)
  • Fix tab/space inconsistency in doc comment blocks for both methods

Follow-up cleanup to PR #218.

Test plan

  • dotnet build succeeds with zero errors (warnings are pre-existing)
  • Verify Query Store grid loads correctly with Group By = None, Query Hash, and Module

🤖 Generated with Claude Code

… grouped fetches

The Step 3 ranked CTEs in both FetchGroupedByQueryHashAsync and
FetchGroupedByModuleAsync joined sys.query_store_query_text without
using any of its columns — the actual text fetch happens in the Final
select. Also fixes tab/space inconsistency in the doc comment blocks
for both methods.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit c25ea80 into dev Apr 13, 2026
2 checks passed
@rferraton
Copy link
Copy Markdown
Contributor

Thanks @erikdarlingdata!
Even better with no join of course!

@erikdarlingdata
Copy link
Copy Markdown
Owner Author

@rferraton no problem! It's a good idea as usual. Thank you!

@erikdarlingdata erikdarlingdata deleted the fix/querystore-groupby-cleanup branch April 19, 2026 00:25
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.

2 participants