【发布时间】:2011-11-11 08:33:57
【问题描述】:
哪种结构更好?
表1
postid category1 category2 category3
2 a b d
3 a c null
或
张贴表
postid
2
3
category_option 表
category option
category1 a
category2 b
category3 c
category4 d
option_post 表
post option
2 a
2 b
2 d
3 a
3 c
似乎第一个结构的构建查询比第二个结构更容易。
【问题讨论】:
-
这真的取决于你想要达到什么目标?一般来说,第二次填充被归一化视图。所以它可能会更好,在某些情况下更快;在其他情况下,第一个会更容易更快;提供更多细节
标签: mysql database-design schema