Skip to content

EXPLAIN option WAL unsupported: WAL needs pgWalUsage counters + show_wal_usage (xloginsert lane) #113

Description

@lrweck

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions