PS-8378: Allow to run EXPLAIN with lower level of privileges #4962
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.
This patch introduces new global dynamic EXPLAIN_OBSERVER privilege which allows users which have it to run EXPLAIN statement for any DML. For users which don't have this privilege EXPLAIN for a DML statement still requires the same privileges as for the DML being explained.
The idea is that users employed by monitoring/performance analysis tools can use this privilege to get information about execution plans for problematic statements, without risk of more data exposure or undesirable data changes which occurrs when they are granted global SELECT/INSERT/UPDATE/DELETE necessary to explain any DML.