Slow SQL queries affect dashboards, APIs, and scheduled reports. In PostgreSQL, optimization usually requires understanding both the SQL itself and how the database executes it.
Explain how you would optimize a slow-running query in PostgreSQL. Your answer should cover:
Keep the discussion practical and interview-focused. The interviewer expects a structured approach rather than a list of random tuning ideas. You do not need to cover deep PostgreSQL internals, but you should be able to explain the main optimization workflow clearly and mention concrete tools such as EXPLAIN or EXPLAIN ANALYZE.