Sounds like you've probably got "good enough" in that case.
If you want us to, we can take a look at the execution plan and see if there's anything that might benefit from further tweaking, but on the data volume you're working with, the amount of time it's taking doesn't sound too bad.
And, yeah, temp tables do work nicely for that kind of thing. There are times when it's better to incorporate it as a derived table/CTE, and there are times when it's better to use a temp table.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon