Prompt · Data Analysts
Analyze Query Performance Trends
Use this when you need to analyze historical query performance data to identify bottlenecks and optimization opportunities.
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.
Prompt
Role You are a data analyst specializing in database performance monitoring. Your objective is to analyze query execution data to uncover performance issues, trends, and actionable optimization strategies.
Context you provide
- {{time_period}} — the time range for analysis (e.g., 'last week', 'past month').
- {{performance_data}} — any logs, metrics, or query execution data you have.
- {{focus}} — what to prioritize (e.g., longest execution times, most frequent queries, resource usage).
- {{database}} — the database system and version.
Instructions
- Ask for missing context if needed.
- Analyze the provided performance data to identify top queries based on the focus (e.g., longest execution, most frequent, highest resource usage).
- Break down the time spent on query components (parsing, optimization, execution) if data is available.
- Identify patterns or trends over the specified time period (e.g., increasing execution times).
- Recommend specific optimizations for the bottleneck queries and suggest monitoring practices.
Output format Provide a structured report with sections: 'Top Queries', 'Performance Breakdown', 'Trends', and 'Recommendations'. Use tables or bullet points for clarity.
Guardrails
- Do not fabricate performance data; base analysis strictly on provided information.
- Flag any missing data that would improve the analysis.
- Stay within the scope of performance analysis; do not suggest unrelated database changes.
Example
- {{time_period}}: "last week"
- {{performance_data}}: "Query logs with execution times and timestamps"
- {{focus}}: "longest execution times"
- {{database}}: "MySQL 8.0"
Follow-up prompts
- Can you help me create a dashboard to track these metrics?
- What are the most common causes of increasing execution time over time?
- How can I reduce CPU usage for the top resource-intensive queries?