Skip to content

Performance

These figures use one entry-tier managed PostgreSQL instance. Workers and the database are on separate machines in one region. The sample covers about 2.5 million statements in 24 hours.

StatementCount in 24 hoursp50p99
Cap advisory lock902,1840 ms0 ms
Notify triggers260,2480 ms0 ms
Claim function150,4171 ms2 ms
Heartbeat insert36,7650 ms1 ms
Finalize fence update35,9230 ms1 ms
Task enqueue insert31,4121 ms2 ms
Requeue or unclaim update31,3500 ms1 ms

The table reports server-side statement time. Network time is separate.

Terminalization remains one database function call. The function locks the live row. It writes the history row. It archives attempts. It deletes live attempts. It deletes the live task. It emits the completion notification.

The transaction writes one history leaf. Its cost includes the leaf’s task-ID and enqueue-order indexes.

Task result and info reads check live storage first. Terminal reads use the staged reader functions.

The staged functions hold a static leaf list. UUIDv7 time orders likely leaf probes. The reader still probes every skipped leaf before absence. Each probe uses the leaf task-ID index.

A missing leaf triggers reader publication on the next maintenance pass. The reader excludes the missing relation. The health report keeps its catalog name.

Each leaf has an enqueued_at btree. A bounded list can merge leaf scans in index order and stop at its limit. Migration 0040 adds the schema-v34 index to existing leaves. New leaves receive the same index.

Filters without a matching index still scan the selected leaves. Add a focused leaf index for a permanent application query. See Operational Indexes.

Task and heartbeat retention drops partitions. Drop cost does not grow with the number of rows in the leaf. A detach can wait for old transactions. The worker caps that wait with a statement timeout.

Workflow and worker-state retention deletes rows in batches. Delete cost grows with the retired row count. Autovacuum must reclaim dead tuples later.

History class duration sets a minimum age. Daily leaf size adds up to one day of retention. Smaller leaves would reduce that margin but would create more relations and indexes.

Cutover duration depends on row count and database speed. Fit the preparation and relocation slopes on the target server. Measure fixed stage time on the same server. Do not copy coefficients from another deployment.

See the task-history cutover runbook.