Describe a time when you had to optimize a slow-performing database query. What steps did you take to identify the bottleneck?