sql server - To use a FK in a one-to-many relationship versus using a join table -
first of little bit of context:
tablea ta
tableb tb
one 'ta' has many 'tb', 1 'tb' can owned 1 'ta'.
i'd ad fk 'tb' pointing 'ta' , it's done. i'm willing model differently (to improve it's readability); want use join table, named 'ta_tb' , set pk 'tb_id', enforce 'one-to-many' clause.
are there performance issues when using approach b in spite of approach a?
whenever normalize database, there performance hit. if join table (or referred cross reference) dbms need work join right records.
dbms's these days pretty creating indexes , reducing these performance hits. depends on situation.
is more important have readability , normalization? use join/xref table.
is small application want perform well? make table b have fk parent.
Comments
Post a Comment