EXPLAIN option WAL unsupported: WAL needs pgWalUsage counters + show_wal_usage (xloginsert lane)
pgrust version: 0.2 (binary pgrust-0.2-linux-x86_64, PostgreSQL 18 compatible)
Component: ExplainOnePlan() in explain.c (WAL usage instrumentation)
Summary
The EXPLAIN (WAL) option fails on every statement, including plain SELECT. PostgreSQL's EXPLAIN WAL option requires the pgWalUsage instrumentation counters collected in the xlog insert lane; pgrust does not expose them, and ExplainOnePlan() hard-errors instead of omitting the WAL section.
Reproducer
EXPLAIN (ANALYZE, WAL) SELECT 1;
Any statement type fails the same way (SELECT, INSERT, UPDATE, ...). Note: upstream PostgreSQL already requires ANALYZE before WAL is accepted (EXPLAIN (WAL) without ANALYZE is rejected by the parser), so the relevant case is EXPLAIN (ANALYZE, WAL, ...), which on pgrust aborts during plan display.
Expected behaviour
On PostgreSQL 18.6 the same EXPLAIN prints a WAL: section on each plan node that generates WAL records, e.g.:
Insert on events_fact (cost=... )
WAL: records=4006 fpi=8 bytes=283985
and a plain SELECT plan unchanged (with no WAL section).
Actual behaviour
ERROR: ExplainOnePlan (explain.c): WAL needs pgWalUsage counters + show_wal_usage (xloginsert lane)
No plan is printed for the statement.
Notes
- Blocks every EXPLAIN run that requests WAL — the entire plan is lost, not just the WAL numbers.
- Any benchmark/profiling harness using
EXPLAIN (ANALYZE, WAL, ...) must special-case pgrust and drop the WAL option, producing plans that are not directly comparable to PostgreSQL output.
EXPLAIN option
WALunsupported:WAL needs pgWalUsage counters + show_wal_usage (xloginsert lane)pgrust version: 0.2 (binary
pgrust-0.2-linux-x86_64, PostgreSQL 18 compatible)Component:
ExplainOnePlan()inexplain.c(WAL usage instrumentation)Summary
The
EXPLAIN (WAL)option fails on every statement, including plainSELECT. PostgreSQL's EXPLAINWALoption requires thepgWalUsageinstrumentation counters collected in the xlog insert lane; pgrust does not expose them, andExplainOnePlan()hard-errors instead of omitting the WAL section.Reproducer
Any statement type fails the same way (SELECT, INSERT, UPDATE, ...). Note: upstream PostgreSQL already requires
ANALYZEbeforeWALis accepted (EXPLAIN (WAL)withoutANALYZEis rejected by the parser), so the relevant case isEXPLAIN (ANALYZE, WAL, ...), which on pgrust aborts during plan display.Expected behaviour
On PostgreSQL 18.6 the same EXPLAIN prints a
WAL:section on each plan node that generates WAL records, e.g.:and a plain SELECT plan unchanged (with no WAL section).
Actual behaviour
No plan is printed for the statement.
Notes
EXPLAIN (ANALYZE, WAL, ...)must special-case pgrust and drop theWALoption, producing plans that are not directly comparable to PostgreSQL output.