More in this categoryCoding Prompts
05 / 12
#01Legacy Code Modernization#02AWS Lambda Handler#03Prototype to Deployment#04Landing Page in HTML/CSS#05Query to Optimized Query#06SQL Query Builder#07Plan Feature Then Build#08Unit Tests Generator#09Codebase Question to Fix#10Refactor Legacy Function#11Function Draft to Production-Ready#12REST API Boilerplate
2-phase workflow
Query to Optimized Query
Get a working query, then optimize it for scale.
Published
Workflow · 2 phases
Phase 1: Phase 1 — Working query
Generate a [DATABASE] query that [BASIC NEED]. Just get the correct results first — clarity over speed. Query: describe what you need in plain words.
Phase 2: Phase 2 — Optimize it
Now optimize that query for a table with 10M+ rows: rewrite with proper indexes in mind, eliminate N+1 patterns, and explain which index you would add and why. Show EXPLAIN-style reasoning.
Related prompts
- Coding Prompts2 phases
Legacy Code Modernization
Analyze legacy risks, then modernize safely.
- Amazon Q Developer
By Rahul Verma - Coding Prompts2 phases
Function Draft to Production-Ready
Draft a working function, then harden it for production.
- GitHub Copilot
By Priya Sharma - Coding Prompts
- Coding Prompts2 phases