How would you optimize a slow database query?

Technical