Skip to content
Discussion options

You must be logged in to vote

You're right, both tables grow without bound today.

How the two tables relate

pgqueuer_log records every job state transition (enqueue, pick, complete, etc.). When you query statistics (e.g. via pgq stats or the log_statistics() method), it first aggregates pending log rows into pgqueuer_statistics at 1-second granularity, marking them aggregated = TRUE. This happens on-demand, not via a background task. Neither table is pruned automatically.

Safe pruning

Once rows in pgqueuer_log are aggregated (aggregated = TRUE), they're only needed for per-job tracebacks or audit trails. For high-volume, short-lived jobs you can safely delete them:

-- Delete aggregated log rows older than 1 day
DELETE F…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@yqiang
Comment options

Answer selected by yqiang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants