【发布时间】:2011-07-17 02:51:27
【问题描述】:
我正在为一个朋友设计一个网站,但我不确定对于我的一个数据库表来说最好的方法是什么。 给你一个想法,这大概就是我所拥有的
Table: member_profile
`UserID`
`PlanID`
`Company`
`FirstName`
`LastName`
`DOB`
`Phone`
`AddressID`
`website`
`AllowNonUserComments`
`AllowNonUserBlogComments`
`RequireCaptchaForNonUserComments`
`DisplayMyLocation`
最后四个
AllowNonUserComments
AllowNonUserBlogComments
RequireCaptchaForNonUserComments
DisplayMyLocation
(将来可能会添加更多此类布尔字段)将根据用户偏好控制某些网站功能。
基本上我不确定是否应该将这些字段移到一个
新表:member_profile_settings
`UserID`
`AllowNonUserComments`
`AllowNonUserBlogComments`
`RequireCaptchaForNonUserComments`
`DisplayMyLocation`
或者如果我应该将其保留为 member_profile 表的一部分,因为每个成员都会有自己的设置。
从长远来看,目标是大约 100000 名成员,在短期内是 10k 到 20k。我主要关心的是数据库性能。
虽然我在回答问题 #2) 移动成员的联系信息是否有意义,例如 地址街道、城市、州、邮编、电话等 strong> 进入 member_profile 表,而不是像我目前拥有的那样拥有地址表和 AddressID。
谢谢
【问题讨论】:
标签: mysql database normalization database-normalization