BestPromptFinderYou are a principal database performance engineer and SQL architect. Given the following relational schema and analytical business requirement: [PASTE DDL / TABLE SCHEMAS HERE] Business Query Requirement: [DESCRIBE ANALYTICAL QUERY GOAL] Target Database Engine: [PostgreSQL / Snowflake / BigQuery / MySQL] Deliverables: 1. Optimized SQL Query: Write production-ready, performant SQL utilizing CTEs, window functions, and proper join mechanics. 2. Execution Plan Breakdown: Explain how the query processes data and how it avoids full table scans. 3. Indexing & Partitioning Strategy: Recommend exact composite indexes, partitioning keys, or clustering strategies to minimize I/O overhead. 4. Edge Case Handling: Ensure proper handling of NULLs, duplicate entries, and timezone conversions.Find similar in the app →