AI Prompt Details
A practical, ready-to-use AI prompt designed to help you solve real business problems faster—with clear steps, proven frameworks, and immediate action.
Optimise Database Schema & Queries with AI
Design a cleaner database schema and speed up slow queries with targeted, practical fixes.

Problem It Solves
Poor schema design and unoptimised queries cause slow performance, high costs, and scaling issues. Developers often lack a clear, systematic way to identify bottlenecks and apply the right indexes or refactors.
Schema Design Review
Improves table structure and relationships.
Query Performance Analysis
Finds slow patterns and bottlenecks.
Indexing Guidance
Suggests indexes with clear trade-offs.
AI Prompt Instructions
Act as a senior database engineer focused on performance and scalability.
Database type: [PostgreSQL / MySQL / MongoDB / other]
Use case or product: [what the database supports]
Current tables or schema (if any): [describe or paste]
Slow or critical queries:
[Paste 1–3 queries]
Expected scale: [small / growing / high-traffic]
Your task:
1) Propose an optimal schema structure for the use case.
2) Identify schema or relationship issues.
3) Review the provided queries for performance bottlenecks.
4) Suggest specific indexes with reasoning.
5) Recommend safe query refactors.
6) Highlight one trade-off or risk to watch for.
Keep recommendations practical and suitable for early production use.
Expected Outcome
You should receive a cleaner schema outline, index suggestions, and improved query patterns.
Implementation Journey
Describe schema & queries
Paste table structures and 1–3 slow queries.
4 minutesGenerate optimisation advice
Run the prompt in an AI editor to get schema and index guidance.
6 minutesApply and test
Add indexes or refactors, then benchmark performance.
10 minutes

