Whenever you're ready, walk me through how you'd approach this.
What is your approach to optimizing SQL queries in a large dataset?
Explain how you diagnose performance issues, identify bottlenecks, and choose appropriate improvements in PostgreSQL. Cover the role of execution plans, indexes, query structure, statistics, and data volume. Discuss how you validate that an optimization improves performance without changing the result.