Skip to content

PostgreSQL Query Shapes statement grid no longer looks blank, and the OS CPU grid shows rounded numbers (#6225) - #6229

Merged
erikdarlingdata merged 2 commits into
devfrom
fix/6225-pg-query-shapes-grid
Oct 20, 2026
Merged

erikdarlingdata merged 2 commits into
devfrom
fix/6225-pg-query-shapes-grid

Conversation

@erikdarlingdata

@erikdarlingdata erikdarlingdata commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Claude posting for Erik Darling.

Closes #6225.

Why

  1. Blank statement rows. The Query Shapes statement grid is not bound to the wrong names and its rows are not null. The cause is layout. A PostgreSQL statement is stored as written, line breaks included. The Statement cell showed every line, so a statement of a few hundred lines made its row thousands of pixels tall. Every cell of a row is vertically centred, so the Query ID, Calls and the other values of that row sat far below the 234 px the grid shows. The visible part of the grid was empty while its scrollbar had a thumb. I reproduced it by building the real server tab, giving the grid a 300-line statement and reading the cells from the laid-out tree: the first row was 4849 px tall and its Calls value sat at 2462 px.
  2. Raw doubles in the OS CPU grid. That grid bound the store's record directly, so CPU, User and System printed the stored double (130.67499999999) and the disk columns printed bare byte counts.

What changes

  • New FreeTextCell style (Themes/DarkTheme.xaml) caps a text cell at 90 px, the same cap the SQL Server grids put on query text. It is applied to the free-text cells of the PostgreSQL Activity tab: Statement, the blocking chain's Root and Victim statements, the captured plan JSON, and the deadlock and log-event grids' Lock Modes, Resources, Victim Statement, Message, Detail and Context.
  • OS CPU grid: new PgDisplay.KernelStat row. The ms columns are rounded to one place like the tab's other ms columns, the disk columns read as sizes (0 B, 3.0 MB), and they sort by the byte count. The headers lose "(bytes)" because the unit is now in the value.
  • Captured plans grid: new PgDisplay.CapturedPlan row; Total, Max and Avg (ms) are rounded to one place (they were raw doubles too).
  • Same raw-double fix in the other Activity, Waits and I/O grids I checked: the lock statistics grid's Max Wait (ms), and the buffer usage grid's % of Pool, % Dirty and Avg Usage. The Waits grids and the I/O stats grid already round their doubles.
  • Not changed: the Vacuum, Replication and Storage tabs' free-text cells (outside Activity, Waits and I/O).

Test plan

  • New ViewerPostgresQueryShapesGridRenderTests (5 tests) build the real PostgreSQL server tab, open Activity and the sub-tab, and read the text each cell shows. With the cap removed from the XAML, the statement-grid and log-event-grid tests fail ("the first row is 4849 px tall in a 234 px grid and its Calls value sits at 2462 px", and the same for the log grid's PID at 4849 px / 220 px); with it they pass. The OS CPU and captured-plans tests check the rounded and sized cell text; they exercise the new mapper rows, so they could not be run against the old code (the mapper did not exist; the old binding was the raw record, which is what the issue shows).
  • Viewer PostgreSQL classes, ViewerGridTimeColumnSortMemberTests, XamlGridRowRangeTests, ViewerClippedText*, every Census and Ratchet class and the Guard trait: 505 tests, 0 failed.
  • .github/scripts/pre-push.sh from pwsh: both Guard stages green (darling 4446, lite 1196, 0 failed). The selection is the whole suite, so the gate stops there and CI decides the rest.
  • Not run: a live viewer against a PostgreSQL 17 store, and the live-store classes (no store was needed: the blank rows reproduce with a laid-out tab).

Last line of pre-push.sh: GATE STOP: selection is the whole suite (darling 2050, lite 577): run the brief's classes; CI decides (over PRE_PUSH_MAX_CLASSES=400 in one project; no selected class ran; logs /tmp/pre-push.CQw7GI)

Proposed CHANGELOG line

SECTION: Fixed
ENTRY:

  • The PostgreSQL Activity grids show their values when a statement or log message has many lines, and the OS CPU grid shows rounded numbers ([PostgreSQL Query Shapes statement grid no longer looks blank, and the OS CPU grid shows rounded numbers (#6225) #6229]) - A statement stored with hundreds of line breaks made its Query Shapes row thousands of pixels tall, which pushed the row's numbers out of view and left the grid looking blank. Text cells in the Activity tab's grids are now capped at a few lines. The OS CPU grid showed raw doubles such as 130.67499999999 and bare disk byte counts; CPU, User and System are rounded to one place and Disk Read and Write show sizes. The captured-plans durations, the lock statistics Max Wait and the buffer usage percentages are rounded the same way.

…as many lines, and the OS CPU, captured-plan, lock and buffer grids show rounded numbers (#6225)
@erikdarlingdata erikdarlingdata added the owner:pm-worker-helper Laptop helper session: click-test fixes. Other sessions leave these alone. label Oct 20, 2026
@erikdarlingdata
erikdarlingdata marked this pull request as ready for review October 20, 2026 15:19
@erikdarlingdata
erikdarlingdata enabled auto-merge (squash) October 20, 2026 15:19
@erikdarlingdata
erikdarlingdata merged commit 0da28da into dev Oct 20, 2026
30 of 31 checks passed
@erikdarlingdata
erikdarlingdata deleted the fix/6225-pg-query-shapes-grid branch October 20, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

owner:pm-worker-helper Laptop helper session: click-test fixes. Other sessions leave these alone.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant