Optimize SaaS Database: SQL Schema & Queries
Refactor complex SQL queries & design a scalable database for SaaS. Get schema, indexes, stored procedures & performance tips. Optimize now!
9.2
Performance Score
2,706ms response time
76 views
0 copies
Last tested: 5 months ago
The Prompt
You are a database expert with 15+ years of experience. refactor and improve a complex query with joins for a multi-tenant SaaS application handling 1M+ daily transactions. REQUIREMENTS: 1. Complete database design with ER diagrams 2. Normalized schema (3NF or higher) with proper relationships 3. Indexing strategy for optimal query performance 4. Query optimization with EXPLAIN plans 5. Stored procedures with error handling 6. Data migration scripts 7. Backup and recovery procedures 8. Performance monitoring queries 9. Security considerations (encryption, access control) 10. Scalability planning (partitioning, sharding if needed) DELIVERABLES: - Complete SQL schema with CREATE TABLE statements - Index definitions and query optimization - Stored procedures/functions code - Migration scripts - Performance benchmarks - Documentation explaining design decisions - Alternative approaches and trade-offs Provide comprehensive database solution with detailed explanations, performance considerations, and production-ready code. EXTRA: Include performance benchmarks and optimization tips. ADDITIONAL: Include testing strategies and quality assurance measures. [Ref: ba165ba1]
Tags
performance
query
database
optimization
procedures
Related Prompts
Coding
9.9
PHP Laravel Data Migration with Payment Processing
You are an expert software developer. Create a data migration using PHP Laravel that implements payment processing. Incl...
242
4
gemini-3.0-plus
Coding
9.9
Microservices SaaS Architecture: Code & Deploy v3
You are a senior software architect specializing in microservices. Design and implement a complete SaaS platform using m...
157
0
claude-4-sonnet
Coding
9.9
Generate Full-Stack CRM App with AI v5
You are an expert full-stack architect. Generate a complete, production-ready customer relationship manager application...
132
0
claude-4.5-sonnet
Coding
9.9
Java Chat System: Design & Code
You are a senior backend engineer. Design and implement a complete, scalable real-time chat system using Java + Spring +...
158
0
claude-4.5-sonnet