How to optimise this database query?

How to optimise this database query?