Skip to content

Database contention and locking redux

Michael Gratton requested to merge mjog/db-result-timing into mainline

Split FTS search table update at startup into a single RO and multiple RW transactions, and drop down email create/merge batch size, both to reduce DB load and lock contention, reducing the odds of getting a "database is locked" error.

To make it easier to spot and diagnose these issues, this also ensure all DB SQL methods are checking for long-running queries, log a warning if > 50% max allowed time, and further cleans up logging of SQL and results.

See #921 (closed) for context.

Edited by Michael Gratton

Merge request reports