Skip to content

Add optional VACUUM buffer and WAL instrumentation - #2103

Draft
Alena0704 wants to merge 3 commits into
apache:mainfrom
Alena0704:vacuum_stats_02_instrumentation
Draft

Alena0704 wants to merge 3 commits into
apache:mainfrom
Alena0704:vacuum_stats_02_instrumentation

Conversation

@Alena0704

@Alena0704 Alena0704 commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

Prepare per-operation buffer and WAL measurements for VACUUM resource
reporting.

Capture buffer activity, block I/O time, WAL records, full-page images and
WAL bytes around heap and index vacuum operations. Accumulate resource usage
across active append-optimized vacuum phases.

Keep table and index measurements separate by subtracting index resource
usage from table totals.

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Checklist

Snapshot buffer activity and block I/O timing around heap, index and AO
vacuum work. Assemble backend-local resource records and accumulate AO
resources over active phases. Keep relation-local block counts, and
subtract index resources from table-only totals to avoid double counting.

Introduce optional instrumentation and its consumer hook. Allocate it only
when a consumer is installed. Persistent storage and SQL access through
the extension follow separately. Native timing and work counters are
introduced in independent branches.
Add WAL record, full-page-image and byte deltas to the backend-local
VACUUM resource measurements. Snapshot pgWalUsage around the same heap,
index and AO phases as buffer usage. Keep index WAL separate from table
resources and accumulate only active AO phases.

Reuse PostgreSQL's existing pgWalUsage instrumentation. Delivery,
persistence and SQL exposure of these counters are added by the separate
extension reporting commit.
@Alena0704
Alena0704 force-pushed the vacuum_stats_02_instrumentation branch from 38c8ffa to b259261 Compare October 9, 2026 16:29
Print buffer, WAL and I/O measurements for heap work, index passes, and each AO vacuum phase. Exclude index resources from the enclosing table or phase report, include local buffer writes, and keep ordinary VACUUM quiet.

Remove the extension hook declaration, definition and collection gates from the instrumentation prerequisite. The extension patch introduces that interface together with its consumer. Drop unused AO aggregate reporting from the core-only patch. Add core TAP coverage without an extension and document VERBOSE output.
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