PostgresAudit
Read-only collector No write access D1 users + KV sessions

PostgreSQL Optimization Audit

Generate a practical Postgres performance report from local collector data: slow queries, missing indexes, unused indexes, table bloat, autovacuum drift, and expensive sorts.

$npx postgresaudit collect --url "$DATABASE_URL" --out audit.json
Local-firstcollector runs on your machine
StructuredJSON in, prioritized report out
Reviewablerecommendations include risk notes
Login required to run reports

Bootstrap the first admin account, then sign in to use the secure audit workbench.

Audit workbench

Sign in before uploading collector output. Reports may contain private schema and query data.

DeepSeek V4 Pro Max
Private workspace

Protect audit uploads with a simple admin login

The collector JSON can expose schema names, slow queries, and table sizes. Login keeps the audit route private while the landing page remains indexable.

Create first admin

This runs once. The first user becomes admin and bootstrap closes after that.

PostgreSQL database optimization audit

What the first report actually checks

Slow query pressure

Ranks pg_stat_statements by total time, mean time, temp writes, and disk reads.

Index opportunities

Surfaces scan-heavy tables, low-usage indexes, and likely composite-index candidates.

Table health signals

Checks row estimates, dead tuple ratios, autovacuum timestamps, and relation sizes.

Workflow

Built for cautious production review

1

Run collector

Use a restricted PostgreSQL user and export audit.json locally.

2

Upload JSON

Paste or upload the collector output into the secure report workbench.

3

Review report

Get prioritized findings with evidence, recommendations, and risk notes.

Sample output

Clear findings, evidence, and next actions

PriorityObjectFindingNext action
Highpublic.ordersSequential scan pressureVerify composite index
Hightop queryTemp writes during sortRun EXPLAIN with buffers
Mediumorders_created_at_idxRarely used indexReview after new index lands
LowautovacuumDead row ratio risingTune per-table threshold
FAQ

Common safety questions

Is PostgresAudit read-only?

Yes. The collector runs metadata and statistics queries, sets read-only session mode, and never executes optimization SQL.

Does it need pg_stat_statements?

It works without pg_stat_statements, but query-level findings are much better when the extension is enabled.

Can it change my production database?

No. The MVP only collects signals and generates a report. Index creation, VACUUM changes, and setting changes remain manual review steps.