|
|
|
|
|
|
|
|
|
Using the FORCE ORDER Query Hint
Force Order does exactly what you'd expect - tells SQL Server to process the tables in the order they are listed. You'll still get the same set of rows when you're done, but you might get them using a different plan, and that plan might be faster. That is the nature of query hints, you have to figure out when to use them and make sure they actually make things better. For this demo we have a view from Adventureworks that - at least without a where clause - performs better if use FORCE ORDER>
|
|
|
|
Duration:
|
3
mins
4
secs
|
|
Skill Level:
|
100
|
|
Rating:
|
4.32
out of 5
|
|
Publish Date:
|
September 21, 2010
|
|
|
|
About the Author
|
|
Andy Warren is a software trainer focusing on SQL Server, a member of the PASS Board of Directors, and a principal in this site - SQLShare.com.
|
|
References
|
|
Comments
|
Charlie Bruno on
9/21/2010
Always leaning something new here. You guys are doing great work educating us.
|
|
|
This video has a much better example of the power of the query hints! Thank you!
|
|
|
That is an excellent way to learn new features one at a time at your convenient time. Thank you very much Andy.
|
|
|
very clear teaching
|
|
|
The video suggested less reads = better performance. I'm not sure this is always the case. Sequential reads would be faster than random reads. And what about other performance measurements such as duration.
|
|
|
You showed page reads but not CPU. In Profiler, the query using the hint had CPU (my guess is for the sort operations). I know that you know to hover your mouse pointer over the final SELECT in the query plan to get an estimated cost. You might have shown that.
|
|
|
Good One Andy...Thanks very much for the simple explanation.
|
|
|
Great video to learn new concept
|
Must Be Logged In
|
|
|
|
|