This prompt implements an end-to-end framework specifically designed for Database Administration & Backend Engineering. It enforces role authority, step-by-step structural reasoning, and negative constraints to prevent generic, repetitive AI filler.
Target Use CaseDatabase Administration & Backend Engineering
Engine CompatibilityChatGPT • Claude • Gemini
Complexity LevelADVANCED
The Complete AI Prompt
1-Click Clipboard Ready
System / Prompt Matrix|185 words (1280 chars)
Copied 4,300 times
Act as a Senior Database Administrator and PostgreSQL Performance Optimization Specialist.
I have a database query that is running slowly or consuming excessive CPU/memory.
Database Engine & Version: [e.g. PostgreSQL 16 / MySQL 8.0]
Table Schema & Approximate Row Count: [PASTE TABLE DEFINITIONS & ROW COUNTS]
The Problematic Query:
[PASTE SLOW SQL QUERY HERE]
Optional EXPLAIN (ANALYZE, BUFFERS) output:
[PASTE EXPLAIN PLAN IF AVAILABLE]
Execute the following performance review:
1. ROOT CAUSE BOTTLENECK ANALYSIS:
- Identify why this query performs poorly (e.g., table scans, missing composite indexes, N+1 query patterns, improper JOIN order, correlated subqueries, memory spill to disk).
2. OPTIMIZED SQL QUERY REWRITE:
- Provide the refactored, highly optimized SQL query.
- Use CTEs (Common Table Expressions), window functions, or subqueries where appropriate for clarity and speed.
3. INDEXING STRATEGY (DDL):
- Generate the exact CREATE INDEX commands (including composite indexes, partial indexes, or covering indexes with INCLUDE clauses).
- Explain the order of indexed columns according to the query's WHERE, JOIN, and ORDER BY clauses.
4. STEP-BY-STEP EXPLANATION:
- Explain what the refactored query does differently and why it drastically reduces I/O cost.
Include table column names and the database engine (e.g. Postgres 16).
02
Review index suggestions
Apply composite index recommendations to your database staging environment.
Verified Output Walkthrough
Sample Input Arguments
Query joining 2.4M orders with 500k customers with date range filter taking 1,850ms.
Verified Benchmark Response
### Optimized Index Recommendation
```sql
CREATE INDEX CONCURRENTLY idx_orders_customer_date
ON orders (customer_id, created_at DESC)
INCLUDE (total_amount, status);
```
Growfyx Engineering Notes
Always test new indexes with EXPLAIN (ANALYZE, BUFFERS) in a staging environment before pushing to production.
Editor Recommendation★ 4.9/5 Rating
Claude 3.5 Sonnet / ChatGPT Plus — Recommended Model Runner
Run this prompt with zero rate limits and maximum intelligence using advanced frontier LLMs.
Improve website speed and performance with AI. This prompt analyzes your existing website and helps identify performance bottlenecks, reduce unnecessary code, optimize assets, and improve loading efficiency.
“Act as a professional web performance optimization expert.
Analyze my existing website and identify ways to improve its speed, performance,...”
Fix website errors faster with AI. This prompt helps identify coding issues, explain their causes, and provide corrected HTML, CSS, and JavaScript code while keeping the existing website structure intact.
“Act as a professional web developer and debugging expert.
Analyze my existing website code and identify the errors or issues based on my re...”
Build a modern, responsive website with AI using HTML, CSS, and JavaScript. This prompt helps generate clean, organized, and mobile-friendly code based on your website requirements, design preferences, and functionality.
“Act as a professional front-end web developer.
Build a modern, responsive website based on my requirements.
Website Type: [Type]
Purpose: ...”
Discover practical AI copywriting prompts for sales copy, product descriptions, and sales follow-up emails. Learn how to create persuasive, customer-focused content that helps turn attention into action.
Discover practical AI prompts for planning, analyzing, and growing a business. Learn how to use AI to create a business plan, analyze your market and competitors, and build a focused marketing strategy with actionable growth steps.