Docs: per-database grants for FinOps Index Analysis (#915)#929
Merged
erikdarlingdata merged 2 commits intodevfrom May 4, 2026
Merged
Docs: per-database grants for FinOps Index Analysis (#915)#929erikdarlingdata merged 2 commits intodevfrom
erikdarlingdata merged 2 commits intodevfrom
Conversation
Adds a Permissions subsection covering the per-user-database mapping + VIEW DATABASE STATE + VIEW DEFINITION grants that sp_IndexCleanup needs to avoid hanging at 100% CPU when the dashboard/Lite login lacks access to a target database. Includes a single-DB block and an sp_MSforeachdb helper, plus the engine-bug explanation (infinite recompile loop, not sys.dm_db_partition_stats per se). Adds a matching troubleshooting entry naming the hang symptom and linking to the new section.
Earlier permissions block was incomplete. VIEW DATABASE STATE + VIEW DEFINITION are necessary but not sufficient: sp_IndexCleanup also queries sys.sql_expression_dependencies via three-part name when scanning for computed columns / check constraints with UDF references, and SELECT on that catalog view defaults to db_owner only. VIEW DEFINITION does not include it. OP confirmed in the issue thread that the previous grant set still yielded Msg 229 on a real workload database. Reproduced locally on SQL2019 with a database containing a UDF-bound computed column and check constraint; adding GRANT SELECT ON sys.sql_expression_dependencies clears it. Run completes in <1s and returns the expected UDF rows. Updates: - Single-DB and sp_MSforeachdb blocks now include the third grant. - Symptoms section split into the two distinct failure modes (hang vs. Msg 229) so readers can identify which grant they are missing. - Troubleshooting bullet covers both symptoms. Co-Authored-By: Claude Opus 4.7 (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
Closes part of #915. Documents the per-database grants that prevent FinOps Index Analysis (`sp_IndexCleanup`) from hanging at 100% CPU when the dashboard/Lite login lacks user mapping in a target database.
Changes
Out of scope
Test plan
🤖 Generated with Claude Code