Show planner statistics on the database diagnostics page
What does this MR do and why?
The planner statistics check from !265314 (merged) runs on every load of the admin database diagnostics page, but the page never showed its results, so administrators only saw them through the Rake task. Each database card now has a Planner statistics section built like the timeouts section: the check's findings as alerts, then a table of the large tables with no planner statistics and the large partitioned tables, with heap size, estimated rows, time since the last ANALYZE, the expected interval and a status badge. The admin area docs gain the matching subsection.
One backend change: the check counts its findings over every relation but returns at most 50 rows, so it now also says whether that list was cut (relations_capped), and both the page and the console print a note under the table when it was. The controller already passes planner_statistics in each database's payload.
Part of #632280 (closed).
Screenshots or screen recordings
| Healthy | With a finding |
|---|---|
![]() |
![]() |
How to set up and validate locally
-
As an administrator, open Admin > Monitoring > Database diagnostics and expand a database card under Database information. On a healthy GDK the Planner statistics section says no table is large enough to report.
-
Create a large table without statistics and reload the page. The section shows an error finding and lists the table as Missing:
CREATE TABLE planner_ui_probe (id bigint, payload text) WITH (autovacuum_enabled = false); INSERT INTO planner_ui_probe SELECT g, repeat('x', 100) FROM generate_series(1, 200000) g; -
Run
ANALYZE planner_ui_probe;and reload: the finding clears.DROP TABLE planner_ui_probe;cleans up.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist.

