数据库表设计的基本原则

1.动态数据和静态数据分离,比如统计作用的列comment_count分出去



2.大文本字段分离,比如article表中的内容字段content分出去



3.对需要比较和查找的字段做hash,比如username和email,另外保存一个username_hash和email_hash



4.电话号码和地址采用多字段存储,例如address_part1、address_part2

猜你喜欢

转载自kongcodecenter.iteye.com/blog/1435127