Skip to content

Draw the plan as a tree with estimated vs actual row bars - #9

Merged
SpookyJumpyBeans merged 2 commits into
mainfrom
feature/plan-tree
Oct 4, 2026
Merged

SpookyJumpyBeans merged 2 commits into
mainfrom
feature/plan-tree

Conversation

@SpookyJumpyBeans

Copy link
Copy Markdown
Owner

Step 3 of the visual demo. This PR also carries the Run-button feedback commit, which was pushed to #8 after #8 had already merged.

  • Each operator has a pair of bars, estimated rows over actual rows, on one log scale for the whole plan. The colours are categorical slots 1 and 2, validated as a pair for colour-vision deficiency and contrast in both light and dark mode.
  • Operators off by MISESTIMATE_FACTOR (10x) or more get a ⚠ icon and a text label. The label carries the meaning, so the flag doesn't depend on colour alone. demo.run() now returns the factor, so the page flags exactly the nodes the text output flags.
  • The tree guides follow the plan's shape. Hovering or keyboard-focusing a row shows the exact counts, total time and self time.
  • A Tree/Text toggle keeps the CLI-style output available; the browser remembers the choice.
  • Below 640px wide, each operator stacks above full-width bars instead of scrolling sideways.

Checked in the browser at 1280px and 375px, in light and dark mode. The console shows no errors.

The page runs the first preset on load, so clicking Run again redrew
the same rows and a near-identical plan, and looked like a dead button.
Each run now shows a Running state (after yielding a frame, since Python
blocks the main thread), numbers itself in the status line, and briefly
highlights the plan and result panels.
Each operator gets a pair of bars, estimated rows over actual rows, on a
log scale shared by the whole plan, so a gap of the same size means the
same factor anywhere in the tree. Nodes off by the profiler's
MISESTIMATE_FACTOR or more are flagged with an icon and label. demo.run()
now returns that factor, so the page and the text output flag the same
nodes.

Hovering or focusing a row shows the exact counts and both timings. The
text rendering stays one click away. Below 640px each operator stacks
above full-width bars rather than hiding them behind a sideways scroll.

The plan now spans the full width under the query and result.
@SpookyJumpyBeans
SpookyJumpyBeans merged commit 79f1256 into main Oct 4, 2026
5 checks passed
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