hardbyte / hardbyte/postgresql-job-queue-benchmarking

Follow-up: expose pg_ash extension as opt-in once the image story is sorted

Open
#9 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Spun out of #pr-for-feat/pg-ash-wait-events.

The harness now does pg_ash-style wait-event sampling itself
(see \`bench_harness/wait_events.py\`), which is option **B** of the
A/B/C trade-off in the PR description: harness-side sampler against
the standard \`postgres:17.2-alpine\` image, no extension install.

This issue tracks option **A**: switching (or extending) the postgres
image to one that ships \`pg_cron\` + the \`pg_ash\` extension itself,
exposed via an opt-in \`--with-pg-ash-extension\` flag.

## Why it's a separate issue

- Today's harness-side sampler covers the data we need for the
cross-system comparison report. Histogram counts per phase are in
\`raw.csv\`, top-N events in \`summary.json\`, the
\`Wait-event breakdown — clean phase\` plot is in \`index.html\`.
- pg_ash inside Postgres adds compact ASH partitions (rolling
retention, time-series queries on an actual table) that are nice
for **post-bench exploration**, not for the report. That's a
separate value prop — ad-hoc \"slice the wait events by minute\"
queries against a real history table.
- pg_ash needs \`pg_cron\` which the standard \`postgres:17.2-alpine\`
image doesn't ship. Switching the image *for everyone* would
confound throughput numbers across runs (different shared libraries,
potentially different defaults). Switching it only when the flag is
set keeps the canonical comparison clean while letting curious users
drop into ASH.

## Likely shape

- New \`--with-pg-ash-extension\` CLI flag.
- When set, override \`POSTGRES_IMAGE\` to a Tembo or custom image with
\`pg_cron\` + \`pg_ash\`.
- After \`start_postgres\`, run \`CREATE EXTENSION pg_cron;
CREATE EXTENSION pg_ash;\`. pg_ash schedules its own samplers via
pg_cron — no harness work beyond the install.
- At end of run, dump pg_ash's ASH table into \`raw_pg_ash.parquet\`
alongside \`raw.csv\` so users have both views.

## Out of scope here

- The harness-side sampler stays. It's the canonical data source for
the cross-system overlay; pg_ash would be a *complementary*
exploration tool.
- We are **not** changing the default image. Whatever image option A
introduces is gated behind the flag.

## References

- pg_ash: https://github.com/NikolayS/pg_ash
- Tembo Postgres images (one example with pg_cron):
https://github.com/tembo-io/tembo/tree/main/images

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.