Its been a while since I have posted, and I thought this was too amazing to NOT share

Apparently, using Check Constraints and adding Foreign Keys not only improves the quality of your database through ensuring referential integrity and data integrity in general, apparently it also helps the Query Analyzer design better plans!

Take a look at this post:

  • 13 Things you should know about statistics and the query optimizer, jump to Point 9.
  • Also, incase you are wondering what he means by “trusted constraint” and “non trusted constraints”, it would be ‘non trusted’ if you allowed existing non-complying data in the table to stay in there. More here on trusted constraints.