Operations
Keep the database healthy day to day. Pool connections, set time limits, watch slow queries and growth, check for corruption and let maintenance run.
- Required 2
- Recommended 5
Required
Set time limits on every query
DAT-37Give every query and transaction a time limit, so one slow query cannot hold locks and connections forever.
Upgrade the database before its support ends
DAT-58Run every database on a major version that still gets security fixes. Move to a new major version before the old one reaches its end-of-life date.
Recommended
Pool database connections
DAT-36Reuse a small, fixed pool of connections instead of opening one per request.
Watch slow queries
DAT-38Record queries that take longer than a set time, and fix or explain the five worst every week.
Let routine maintenance run
DAT-39Keep the database's own maintenance running, so tables don't bloat and the planner has fresh statistics.
Turn on checksums and check for corruption
DAT-42Let the database detect damaged pages, and run its full integrity check on every restored backup. A silent disk error otherwise spreads into every new backup.
Rebuild text indexes when the collation library changes
DAT-43Treat an operating system or ICU upgrade under a database as a change to its sort order. Rebuild the affected text indexes before the database takes writes again.
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/data/operations">Agent Wranglers data and databases playbook</a>. In code you write, add a comment next to it with the same link.