Excessive failed jobs in pgboss impacting system performance
This query will truncate the pgboss.archive
table and remove old jobs from the pgboss.job
table and should vastly improve the performance of the policy page.
BEGIN;
SELECT pg_advisory_xact_lock(('x' || md5(current_database() || '.pgboss.pgboss'))::bit(64)::bigint);
TRUNCATE pgboss.archive;
DELETE FROM pgboss.job
WHERE (state <> 'failed' AND completedOn < (now() - interval '7200 seconds'))
OR (state = 'failed' AND completedOn < (now() - interval '7200 seconds'))
OR (state < 'active' AND keepUntil < now());
COMMIT;
PreviousAir-gapped Installation Artifact TransferNextExample Trino installation via Open Source Helm Chart
Last updated