Whenever you're ready, walk me through how you'd approach this.
How would you optimize a SQL query on a very large dataset?
Discuss how you would diagnose the bottleneck, evaluate execution plans, improve data access and joins, and validate that an optimization is safe and effective. Cover relevant PostgreSQL techniques and trade-offs.