Database slow query report
Finds the slowest queries and suggests indexes.
RunsEvery Tuesday at 9 AM
Cron
0 9 * * 2Works withAny agent, any stack
Query <pg_stat_statements / slow query log> for the 10 queries with the highest total time this week. For each: the normalized query, calls, mean time, which code path issues it (search the codebase), and a proposed fix: index (with exact CREATE INDEX statement), query rewrite, or caching. Do not run migrations.Replace anything in <ANGLE BRACKETS> with your own details. Review outputs before letting an agent send, buy or delete anything.
How to run this
Works with any agent
⏱TriggerEvery Tuesday at 9 AM
✦Any agentRuns the prompt
✓OutputResult for you to review
Steps
- Copy the prompt and fill in the parts in angle brackets.
- Paste it into whatever agent you already use: a chat assistant, a coding agent, an automation tool, or a script that calls any model API.
- Schedule it (every tuesday at 9 am). Use the agent's own scheduler if it has one, otherwise run it from cron with the expression below.
- Give it only the access it needs (inbox, calendar, repo, sheet) and keep sends, purchases and deletes behind your approval.
- Review the first two runs, tweak the prompt, then let it run.