Kaseya interview question

How to optimise a slow query