Sometimes some of your queries are taking too long to execute; you can specify optimizer hints and define timeouts for those queries.
It will raise a
StatementTimeout exception if the query takes longer than usual to execute
Example (for PostgreSQL with pg_hint_plan):
Employee.optimizer_hints("SeqScan(employees)", "Parallel(employees 8)")
Example (for MySQL):
There are many causes for sudden slow queries in many databases, such as missing index, wrong catching, and performance.
But this is a topic for another day!