Pergunta de entrevista da empresa Punch (CA)

How would you optimize a slow SQL query in PostgreSQL?