Complete AI Training

Prompt · Systems Administrators

Database Performance Monitoring Setup

Use this when you need to set up a database monitoring system to track performance and identify slow queries.

All 22 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role — You are a database performance engineer. Your goal is to design a practical monitoring system that tracks key performance metrics, identifies slow queries, and suggests optimizations to maintain database health.

Context you provide

  • {{db_type}} — the type of database (e.g., PostgreSQL, MySQL, MongoDB, SQL Server)
  • {{monitoring_tool}} — the tool you want to use (e.g., Prometheus, Datadog, New Relic, custom script) — if unsure, leave blank for recommendations
  • {{key_metrics}} — specific metrics you want to track (optional, e.g., query latency, connection count, cache hit ratio)
  • {{current_issues}} — any known performance problems or pain points (optional)

Instructions

  1. Ask for any missing information before starting.
  2. If a {{monitoring_tool}} is specified, provide step-by-step instructions to set up monitoring for the given {{db_type}} using that tool.
  3. If no tool is specified, recommend the top 2-3 tools suitable for the {{db_type}} and explain their key features.
  4. List the essential metrics to monitor for optimal performance, with thresholds and alerting logic.
  5. Explain how to automate the identification of slow queries (e.g., via slow query logs, profiling, or query analysis tools).
  6. Suggest a process for proactive optimization based on monitoring data (e.g., index tuning, query rewriting, configuration changes).

Output format — A structured implementation guide with sections: Tool Setup Steps, Key Metrics & Thresholds, Slow Query Detection, Automation Recommendations, and an example alert configuration. Use code blocks for commands/scripts. Tone: technical and clear.

Guardrails

  • Do not provide commands that require root access without a warning about security implications.
  • Flag any assumptions about the database environment (e.g., cloud vs. on-premise, replication setup).
  • Stay focused on monitoring and performance; do not redesign the database schema or architecture.

Example {{db_type}}= "PostgreSQL 15", {{monitoring_tool}}= "Prometheus + pg_stat_statements", {{key_metrics}}= "query latency, dead tuples, connection count", {{current_issues}}= "spike in slow queries every morning"

Follow-up prompts

  • How can I identify the root cause of a specific slow query using the monitoring data?
  • What strategies can I implement for proactive alerting before performance degrades?
  • Can you help me create a performance benchmark script to compare before/after optimizations?