Manual database clean-up
When you are using an external high volume database, the out-of-the-box periodic clean-up threads can be disabled in order to have fine control over when clean-up is performed.
For example, running clean-up only between the hours of 1am – 4am when traffic on the services is low.
The periodic clean-up threads run on an interval that is set in advanced configuration settings. Use these settings to disable periodic cleanup. See Advanced configuration properties.
When you are performing the clean-up, it is essential that database locks are efficient to stop contention. The recommended pattern is to open a read-only cursor on the statement. It identifies rows to be deleted and reuses the cursor to perform the deletion one row at a time. This minimizes the size and duration of the write lock.
- A select pattern. This pattern returns a list of IDs that needs to be deleted.
- A delete query.