Describe a scenario where you had to debug a slow-performing database query. What steps did you take to optimize it?