This is a question about SQL Server 2008 R2
I\'m not a DBA, by far. I\'m a java developer, who has to write SQL from time to time. (mostly embedded in code). I want
There are lot of things to tackle here, indexes, execution plans, etc. Testing and comparing results is the way to go.
You could take a look to the usual suspects, indexes. Take a look into the execution plan and compare them. Make sure the WHERE clause is using the correct ones. Ensure you are using the indexes on your JOINs.
These answers sure will help you a lot.