Does SQL Server 2008 interconnect make queries faster?

For example, if I have a BlogPosts table and a PostCategory table, where the BlogPosts table has a FK PostCategoryId field. Will the connection make the request faster or is it rather the quality of the data?

How about when the join table is involved? Take the PostCategoryId field from the BlogPosts table and get the β€œin between” table called PostsInCategories , which has only 2 FK fields: BlogPostId and PostCategoryId combined for the PK form.

Do relationships help improve queries?

+4
source share
1 answer

External key relationships are to ensure data integrity , for example. make sure you don't have any voodoo child lines that no longer have a parent line, etc.

External key relationships alone do not increase your productivity, because SQL Server does not automatically create any indexes for foreign keys.

For several reasons (improving performance while maintaining referential integrity and increasing JOIN performance - see Kimberly Tripp blog post ). the recommended step for adding indexes to all foreign key fields in your tables - and adding these indexes will speed up queries that will use these FK relationships.

+7
source

All Articles