I have a script that was created in a previous version of SQL and I'm trying to improve the performance but obviously get the same results. Can you please help me find the most efficient way of getting the results from the following scripts please:
I think I should probably know this but would like some other opinions. I don't want to get to the situation where I spend ages finding a very small gain.
asked Jun 14, 2011 at 01:00 AM in Default
As with most things it depends! You could try experimenting with joins ...
Gail Shaw posted some interesting pieces comparing EXISTS and JOINs and IN
answered Jun 14, 2011 at 01:15 AM
Kev Riley ♦♦
I like Kev's references to Gail's blog posts. Excellent stuff.
The simple addition I would make is, check the execution plans of all three queries and be sure you're getting good index use (seek instead of a scan, no lookups) because otherwise, regardless of structure, you're likely to get poor performance.
answered Jun 14, 2011 at 03:29 AM
Grant Fritchey ♦♦