Jill
Jill

Reputation: 533

SQL Server table design

I have a table containing about 30 columns. 10 of the columns can only be populated from a list of values.

Right now these values are stored as varchar, straight in the table.

Should I create separate tables for these values and map the 2 tables with a foreign key on the IDs?

Will it improve performance if there are IDs instead of words? Or will it decrease performance because when we query we have to join all the time? Or does it not make a difference in performance?

I am also concerned about the integrity of the data.

Thanks.

Upvotes: 1

Views: 89

Answers (1)

aF.
aF.

Reputation: 66687

Foreign Keys are a relational integrity tool, not a performance tool. At least in SQL Server, the creation of an FK does not create an associated index, and you should create indexes on all FK fields to improve look up times.

So, FKs don't boost performance, but making indexes will :)

Upvotes: 3

Related Questions