[SDBM-2648] Add collect_execution_plans option to SQL Server DBM#23961
[SDBM-2648] Add collect_execution_plans option to SQL Server DBM#23961na-ji wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Adds a new `collect_execution_plans.enabled` config flag (default: true) that lets users disable execution plan collection independently of query metrics. When false, the query-metrics job still runs and emits metrics and FQT events, but skips the _collect_plans loop. SDBM-2648 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
431113d to
9b8dcca
Compare
| ## Configure the collection of query execution plans. Execution plans are collected as part of | ||
| ## the query metrics job and emitted as query samples. Disabling this keeps query metrics | ||
| ## collection running while skipping plan collection. | ||
| ## This option only applies when `dbm` is enabled. | ||
| # | ||
| # collect_execution_plans: | ||
|
|
||
| ## @param enabled - boolean - optional - default: true | ||
| ## Set to `false` to disable collection of query execution plans. | ||
| # | ||
| # enabled: true |
There was a problem hiding this comment.
I hesitated to add this config under query_metrics, since it's the query_metrics job that is collecting the plans.
Also, I believe this config should be hidden. What do you think?
There was a problem hiding this comment.
Does this option have any affect if query_metrics is disabled?
There was a problem hiding this comment.
Huh, that's probably the question I should have asked myself before hesitating 😅. So to answer your question: yes, if query_metrics job is disabled, then no plans are collected. It means that I should probably move the config over there
Plans are collected by the query-metrics job and are already disabled when query_metrics.enabled is false, so the toggle belongs there. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Validation ReportAll 21 validations passed. Show details
|
What does this PR do?
Adds a new
collect_execution_plansconfiguration block to the SQL Server DBM integration. Whencollect_execution_plans.enabledis set tofalse, the query-metrics job continues to collect and emit query metrics and FQT events, but skips execution plan collection entirely.Motivation
Some users want query metrics without execution plan collection — for example to reduce load from
sys.dm_exec_query_planlookups, or for policy/privacy reasons around plan XML. Previously the only way to disable plans wasquery_metrics.enabled: false, which also stopped metric collection.The new option follows the existing
collect_*block pattern used bycollect_settings,collect_schemas,collect_deadlocks, etc.Review checklist (to be filled by reviewers)
qa/requiredif this PR needs QA validation, orqa/skip-qaif it does not. Exactly one of the two is required.backport/<branch-name>label to the PR and it will automatically open a backport PR once this one is merged