SQL Optimizer Overview Analyze SQL queries for performance problems and produce optimized versions with appropriate indexes. Covers query rewriting, index recommendations, execution plan analysis, and common anti-patterns. Instructions When a user asks you to optimize a SQL query or fix slow database performance, follow these steps: Step 1: Get the query and context Determine: - The full SQL query to optimize - Database engine (PostgreSQL, MySQL, SQLite) - Table sizes (approximate row counts) - Existing indexes - Current execution time If you have access to the database, gather this yourself:…