• It could have been worded better with the parent and referenced tables. I second guessed how I've been saying it with how it's worded in sys.foreign_keys.

    In terms of calling it a join instead of a constraint, it is a constraint which is being handled through joins between tables. The point I'm going for is that in terms of performance, look at this like you would other joins in your database. If you use the join often enough or in performance-critical places then you're going to want to make sure you're indexing it.

    Like you, not all of my foreign keys are indexed on both sides. Before I wrote this script some of those instances were accidental and some were intentional. Now every foreign key that doesn't have an index on both sides is an intentional part of my indexing strategy.


    Steve Hood

    Blog: Simple SQL Server
    Twitter: @SteveHoodSQL