Describe a time when you had to optimize a slow-performing SQL query. What was the cause, and how did you resolve it?