【发布时间】:2008-12-12 08:30:28
【问题描述】:
我想为一个电子学习站点建立一个线程论坛(当然是开源的 asp.net mvc,尽管这对这个问题无关紧要)。
什么样的数据库结构才能帮助以最佳性能检索论坛帖子?我没有拒绝。到它,因为它可能会随着被检索的行数而变化。
此外,我应该能够将特定线程与另一个线程链接。例如。显示“相关论坛链接”。
我使用的是 SQL Server 2005。
以下是我想到的结构(无耻地取自) Stephen Walther Excellent blog post
表格:论坛
· Id
· ParentId (null if this is the first message)
· ParentThreadId (Identify message in the same thread)
· Author
· Subject
· Body
· PostedDate
表格:相关论坛
· ForumId
· RelatedForumId
欢迎提出想法/建议。
提前致谢。
【问题讨论】:
-
感谢所有回复。我仍然会保留这个问题以获得更多意见,因为我还有一些时间来完成整体设计。
标签: database-design forum