DocuSign Insight - How does Insight do Postgres Maintenance?

By default, Insight is configured to run background jobs to keep the Postgres database healthy. There are two specific tasks that update indexes and reclaims disk space. These two Postgres commands are:

  • Vacuum analyze verbose - see this Postgres link for further information
  • Reindex database Seal - see this Postgres link too

By default this job is run at 1 AM on Saturday night. This is controlled by the application.conf file under %SEAL_HOME%\config\seal\seal-back\seal-ws.

postgres {
maintenance
{ 
   # enabled = true 
   # cronExpression = "0 0 1 ? * SAT" }
}

You want to schedule this job when there is little or no usage going on in the system so you may need to adjust this time depending on usage.

Here are some more spring cron examples:

"0 0 * * * *" = the top of every hour of every day.
"0 0 8-10 * * *" = 8, 9 and 10 o'clock of every day.
"0 0 8,10 * * *" = 8 and 10 o'clock of every day.
"0 0 9-17 * * MON-FRI" = on the hour nine-to-five weekdays
"0 0 0 25 12 ?" = every Christmas Day at midnight

The two processes do work together but if this leads to an issue then you need to disable the maintenance by changing enabled = false and perform vacuums and reindexes externally to the application. It is recommended to vacuum the database often so as to reduce the impact each individual vacuum creates. Rebuilding indexes is not expedited by frequent rebuilds, but if you find your performance dropping, it is important to rebuild your indexes to improve query performance.