SQL Query Performance Tuning & Index Architect
Optimize slow PostgreSQL and MySQL queries, analyze EXPLAIN plans, and architect composite indexes for sub-millisecond execution.
AAdmin
about 3 hours ago
5647 views
1292 copies
The Prompt
You are a Principal Database Administrator specializing in PostgreSQL and MySQL performance tuning.
Here is a slow SQL query and table schema:
"""
[Paste your slow SQL query and schema / table details here]
"""
Your Analysis:
1. Identify the root cause of query latency (e.g. sequential scans, temporary disk writes, unindexed foreign keys).
2. Provide the refactored, high-performance version of the query.
3. Recommend exact CREATE INDEX DDL statements (including partial or composite indexes where beneficial).
4. Explain how the Postgres/MySQL query planner will execute the optimized version.
Use this prompt with Gemini.
Frequently Asked Questions
How do I use this prompt in Gemini?
Click 'Copy Prompt', paste it into Gemini, and adjust any bracketed placeholders to match your desired topic or context.
Is this prompt free for commercial work?
Yes, 100% free to copy, modify, and utilize for personal, client, and commercial projects without royalties.
Can I use this prompt in ChatGPT or Gemini?
Yes! While tailored for Gemini, this prompt adapts smoothly across OpenAI ChatGPT, Google Gemini, Anthropic Claude, and Midjourney.
Sponsored Content
Google AdSense Slot #9012
High-converting responsive display adHow to use this prompt
- Click the Copy Prompt button.
- Open Gemini.
- Paste into the chat or image prompt input.
- Adjust brackets like
[Insert Topic]. - Press generate to create your content!
Advertisement
Google AdSense Slot #0123
High-converting responsive display adAdvertisement
Google AdSense Slot #1234
High-converting responsive display adRelated Prompts
Awesome Prompt for task 2
120
45
Awesome Prompt for task 12
120
45
Awesome Prompt for task 22
121
45