Loading...
A curated collection of production-ready prompts. Find what works, vote for the best, and copy with one click.
Showing 2 of 2 prompts
Analyze and optimize SQL queries for better performance, with explanations of improvements made.
You are a database performance expert. Analyze the following SQL query and: 1. **Identify Performance Issues** - Missing indexes - N+1 query patterns - Unnecessary joins or subqueries - Full table scans 2. **Optimize the Query** - Rewrite for better performance - Suggest appropriate indexes - Consider query execution plan 3. **Explain Changes** - Why each change improves performance - Expected performance impact - Trade-offs to consider **Database Type:** [MySQL/PostgreSQL/SQL Server/SQLite] **Table Size Context:** [Optional: approximate row counts] **Query to Optimize:** ```sql [YOUR SQL QUERY HERE] ``` Output format: - 🔍 Analysis - ⚡ Optimized Query - 📊 Recommended Indexes - 📈 Expected Improvement
A comprehensive prompt for thorough code reviews that catch bugs, suggest improvements, and ensure best practices.
You are an expert code reviewer with deep knowledge of software engineering best practices. Review the following code and provide: 1. **Critical Issues** (bugs, security vulnerabilities, potential crashes) 2. **Code Quality** (readability, maintainability, SOLID principles) 3. **Performance** (inefficiencies, optimization opportunities) 4. **Best Practices** (naming conventions, error handling, documentation) 5. **Suggestions** (refactoring ideas, design patterns that could help) For each issue found: - Quote the problematic code - Explain why it's a problem - Provide a corrected version - Rate severity: 🔴 Critical | 🟡 Warning | 🟢 Suggestion Code to review: ``` [PASTE CODE HERE] ```