You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9c3fceb
Browse filesBrowse the repository at this point in the historyBrowse files
Link every warning to the operator it came from (#440) (#446)
A warning did not record where it came from, so on a large plan there was no way to
get from a finding to the thing that produced it. pgfiore's framing was exactly
right: "if the plan is huge and the warning origin is murky, it would help to click
a warning and be beamed up to a specific step."
PlanWarning.OriginNodeIds carries it, and the interesting half of this feature is
knowing when to say nothing. Three honest answers, not one:
- A key lookup came from exactly one operator.
- A table variable warning came from every operator that touched one, which on a
real plan is several. That rule already walked the tree and knew precisely which
ones; it threw the answer away before emitting. It does not any more.
- "High Compile CPU" happened before a single row was read, and SQL Server reports
"UDF Execution" at the statement level only. Those have NO operator origin and
now say so, so the UI offers no link rather than one that goes somewhere
arbitrary. Sending a reader to the wrong operator is worse than sending them
nowhere, because they would believe it.
Operator warnings are stamped in ONE place, at the end of AnalyzeNode, rather than
at the 26 sites that add one - the same reasoning as the provenance stamp in #439
and the ceiling in #438. A rule you have to remember at every construction site is
a rule that eventually gets forgotten, and the once it is forgotten the UI quietly
drops a link that existed. It only fills what a rule left empty, so a rule that
knows better keeps its own answer.
The scope call worth reviewing. The pop-up the issue is about shows STATEMENT
warnings, and few of those can attribute to an operator - so linking only those
would not have served the huge-plan case that motivated the request at all. The
warnings that do have origins are the operator ones, and until now the only way to
see one was to have already clicked the operator carrying it, which is no help when
you do not know which operator to click. So the statement panel also gains an
"Operator Warnings" section indexing every warning in the tree, each one a link.
Nothing is removed from the per-operator panel; this is an index into it. It is
collapsed by default because on a large plan it is the longest section in the panel
and expanding it would push the statement's own details off screen, which is the
opposite of the problem being solved.
The tree walk lives in Core as WarningIndex rather than beside the panel that
renders it: it is a walk over Core's own models with nothing UI about it, and there
it can be tested without standing up Avalonia. It uses an explicit stack rather
than recursion, because a deep plan is precisely the case this feature exists for
and #430 was a crash caused by assuming operator trees are shallow.
CLI output contract: "origin_node_ids" is additive on every warning, so
ExpectedCompactOutputSha256 is rolled - second time, both additive, both
deliberate. Verified that origin_node_ids is the ONLY new key rather than assuming
it: the full key set on a warning is otherwise unchanged.
WarningBaseline.txt does not move. It digests type, severity and message, none of
which changed, so no committed plan's verdict is affected.
Tested: 314 total, 312 passed, 0 failed. The new tests pin both directions - that
across every committed plan no operator warning is left without an origin or points
away from its own node, that the table variable warning names the operators that
touch one, and that High Compile CPU and UDF Execution claim none. The index is
compared against an independent recursive walk rather than a hand-written count, so
it cannot drift as fixtures are added.
Not verified: the click itself. This box has no reachable display session, so
screencapture fails and I could not watch a warning navigate. The app was launched
on a plan carrying both kinds of warning and ran clean with no exceptions, and the
logic underneath is covered, but someone with a screen should confirm the scroll
lands where it should before this is trusted.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Message="Table variable detected. Table variables lack column-level statistics, which causes bad row estimates, join choices, and memory grant decisions. Replace with a #temp table.",
Message="This query modifies a table variable, which forces the entire plan to run single-threaded. SQL Server cannot use parallelism for modifications to table variables. Replace with a #temp table to allow parallel execution.",
0 commit comments