Operations Required
Watch slow queries
Record queries that take longer than a set time, and review the worst ones regularly.
How to do it
In PostgreSQL, load pg_stat_statements through shared_preload_libraries and set log_min_duration_statement, such as 500 ms. In MySQL, use the slow query log. Review the top queries by total time each week, because a fast query run a million times can cost more than one slow one.
How to check
Run a deliberately slow query. It appears in the slow query log or the statistics view.
For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers data playbook: https://agentwranglers.se/playbook/data/operations/slow-query-log.