Take a SQL query (especially one you wrote 6 months ago) and explain what it does, plus suggest performance improvements.