How to optimize this query

Printable View