-
Notifications
You must be signed in to change notification settings - Fork 195
Closed
Description
We create 200-300K jobs a day and leave them in place for 7 days for analysis. We have a worker that then deletes the jobs finished older than 7 days. It all works but it can be slow and it can take longer than 60 seconds causing a Postgres statement to time out if we've a lot of extra load, e.g., 1M jobs needing to be deleted.
Even with an index on finished_at we've identified that the problem is that the que_state_notify procedure is doing a lot of work when deleting a large number of records.
I was wondering if others have had this problem and what they what others have done to solve this problem before I dive too deep into it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels