Skip to content

sp_IndexCleanup: scope usage stats staging to filtered objects#720

Merged
erikdarlingdata merged 1 commit intodevfrom
fix/indexcleanup-scope-usage-stats
Mar 25, 2026
Merged

sp_IndexCleanup: scope usage stats staging to filtered objects#720
erikdarlingdata merged 1 commit intodevfrom
fix/indexcleanup-scope-usage-stats

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

Adds EXISTS filter against #filtered_objects when pre-staging dm_db_index_usage_stats, scoping from all touched indexes in the database to only objects being analyzed.

🤖 Generated with Claude Code

Adds EXISTS filter against #filtered_objects when populating
#usage_stats, so only indexes on objects we're analyzing are staged
instead of every touched index in the database.

Tested on SQL2022.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit 056f18c into dev Mar 25, 2026
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.

1 participant