Skip to content

feat: pg_stat_statements JIT screen (hotkey x sub-screen) (#007)#142

Merged
lesovsky merged 21 commits into
developfrom
feature/pg-stat-statements-jit
Jun 22, 2026
Merged

feat: pg_stat_statements JIT screen (hotkey x sub-screen) (#007)#142
lesovsky merged 21 commits into
developfrom
feature/pg-stat-statements-jit

Conversation

@lesovsky

Copy link
Copy Markdown
Owner

Summary

Adds a 7th pg_stat_statements sub-screen — JIT — under the X menu (and the x cycle), showing per-statement JIT compilation cost. Last feature of release 0.11.0 (closes [007]).

  • Query (internal/query/statements.go): PgStatStatementsJITPG15 (PG15/16, 13 cols) / PgStatStatementsJITDefault (PG17+, 15 cols, +deform) + SelectStatStatementsJITQuery(version) (string, int, [2]int, int); WHERE jit_functions > 0.
  • View (internal/view/view.go): statements_jit entry — MinRequiredVersion PostgresV15, NotRecordable: true, OrderKey 2 (gen_total) desc, jit=off hint in Msg; Configure() patches query/Ncols/DiffIntvl/UniqueKey per version.
  • TUI (top/menu.go, top/config_view.go): 7th menu item + menuSelect case; x-cycle wal → jit → timings.

Columns: user, database, gen_total, inline_total, opt_total, emit_total [,deform_total], gen,ms*, inline,ms*, opt,ms*, emit,ms* [,deform,ms*], functions*, queryid, query (* = interval/diffed).

Versioning

PG15/16 base set; PG17/18 add deform_total/deform,ms. PG<15 → "not supported" via the existing VersionOK runtime guard. TUI-only, NotRecordable (record/report deferred per the 0.11.0 TUI-first principle).

Tests

  • New: TestSelectStatStatementsJITQuery (both version branches) + PG15+ gated exec sub-test.
  • Count-tests bumped: TestNew 26→27, TestView_VersionOK (PG16 row) 26→27, Test_filterViews wantN +1; TUI Test_selectMenuStyle/Test_statementsNextView/Test_switchViewTo updated.
  • Local: build/vet/gofmt + feature tests green; manual TUI check on PG17 OK. Full lint + PG14–18 exec matrix via CI.

SDD artifacts

docs/features/007-feat-pg-stat-statements-jit/ (user-spec, tech-spec, tasks, decisions — all validated/approved).

🤖 Generated with Claude Code

Alexey Lesovsky and others added 21 commits June 22, 2026 08:15
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…add duration-sort AC

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…t + x-cycle note

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… fixes

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Strengthen TestNew_StatementsJITView Msg assertion to pin the load-bearing
jit=off empty-screen hint (Decision 4), mirroring TestNew_StatIOTimeView.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Update existing regression tests broken by the new JIT menu item and
x-cycle hop (dev-test-reviewer critical findings): menuPgss item count
6->7, statements_wal->statements_jit->statements_timings cycle.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…assed round 2)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…etrics

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lesovsky lesovsky merged commit 23c8717 into develop Jun 22, 2026
1 check passed
@lesovsky lesovsky deleted the feature/pg-stat-statements-jit branch June 22, 2026 04:13
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