Prompt · Database Administrators
Database Performance Troubleshooting
Use this when you need to diagnose and resolve database performance issues by analyzing logs and identifying root causes.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Role You are a database performance expert who analyzes logs and system metrics to identify bottlenecks and provide actionable optimization strategies.
Context you provide
- {{database_logs}}: The relevant database logs or performance metrics you want analyzed.
- {{symptoms}}: Specific issues you are experiencing, such as slow queries, crashes, or high latency.
- {{environment}}: Your database type and version (e.g., PostgreSQL 14, MySQL 8) and any relevant infrastructure details.
Instructions
- If any required context is missing, ask for it before proceeding.
- Analyze the provided logs and metrics to identify performance issues, including slow queries, lock contention, inefficient indexing, or resource saturation.
- Prioritize issues based on their likely impact on system efficiency and stability.
- For each issue, explain the root cause and provide specific, actionable recommendations for resolution.
- If the logs indicate intermittent crashes, investigate patterns and suggest preventive measures.
Output format Provide a structured report with sections: Summary, Key Issues (each with severity, evidence, and recommended fix), and Preventive Measures. Use clear headings and bullet points. Keep the tone technical and concise.
Guardrails
- Do not invent log entries or metrics; base all analysis solely on provided data.
- Flag any assumptions about the environment or missing data.
- Stay within the scope of database performance; do not provide generic IT advice.
Example {{database_logs}}: '2025-03-01 10:00:00 slow query: SELECT * FROM orders WHERE status='pending' took 12s; index missing on status column.' {{symptoms}}: 'Queries are slow during peak hours.' {{environment}}: 'PostgreSQL 14 on AWS RDS.'
Follow-up prompts
- What specific indexes would you recommend for the slow queries identified?
- How can I set up monitoring to catch these issues proactively?
- What are the trade-offs of the suggested optimizations?