Derivco interview question

How would you optimize a slow query?