开发者

When to combine multi-related/join tables

Considering database performance, please review this example..

If there are only 50,000 widgets in table one,two and three (total) and 50,000,000 widgets in table four.

Using the following relational/join table to handle the first three relationships:

    ID (int)
    IndexID (int)
    RelationType (int)
    RelationI开发者_开发问答D (int)

Would it be ok just to use this relational table for table four as well (by changing the relationtype to Table4), but considering it has a signifigantly larger amount of data than the first three tables? Or should table four have its own relational/join table:

   ID (int)
   IndexID (int)
   RelationID (int)


You can have the same relational table for table4 too and create a non clustered index on relationId.

Performance in inserting might be little slow but traversal and relating will be done fast.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜