• taylor_benjamin (8/23/2010)


    I disagree that option 1 is the right choice. It stated that Option 1 was faster and must therefore be the correct choice. However, option 1 lost a constraint that was part of the table in the first place. How could this be the correct choice?

    Hi Taylor,

    I'm afraid I don't understand your concern. You write that option 1 loses a constraint and hence can never be the correct choice. But this is not correct - it is not option 1, but option 2 that loses a constraint.

    I do of course agree that performance comes after correctness, so that the "correct" option always has to be picked over the incorrect option regardless of which one is faster. But in this particular case, option 1 is the correct one (and it being faster is an additional bonus).


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/