What#39;s better - many small tables or one big table?(什么更好 - 多张小桌子还是一张大桌子?)
问题描述
我有一个数据库,可以存储有关个人的个人资料.这些人有大约 50 个可能的领域.
I've got a database which will store profiles about individuals. These individuals have about 50 possible fields.
有些是常见的,例如名字、姓氏、电子邮件、电话号码.
Some are common things like, first name, last name, email, phone number.
其他是爱好、技能、兴趣等
Others are things like hobbies, skills, interests
有些是身高、体重、肤色.
Some are height, weight, skin color.
系统在不同时间使用这些组中的每一个.就能够通过数据库进行协商而言,我更喜欢有 7 个表,每个表大约有 8 个字段.最佳做法是什么?
Each of these groups are used by the system at different times. In terms of being able to negotiate through the database I would prefer to have 7 tables each of about 8 fields. What is best practice to do?
数据将用于搜索引擎,用于查找配置文件匹配项.这会影响我的工作吗?
The data is going to be used in a search engine, for finding profile matches. Does this affect what I am doing?
推荐答案
这很难说,要根据应用程序的需要而定.我会说研究 Database Normalization 因为它会告诉你如何规范化数据库它应该阐明您想要将哪些内容分离到他们自己的表格等中.
It is hard to say, and is based on what the application requires. I would say to look into Database Normalization as it will show you how to normalize the database and in that it should shed light on what you would want to separate out into their own tables etc.
这篇关于什么更好 - 多张小桌子还是一张大桌子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:什么更好 - 多张小桌子还是一张大桌子?
基础教程推荐
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- 无法解决整理冲突 2021-01-01
- 是否可以执行按位分组功能? 2021-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
- 在 SQL 中连接多个表 2021-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
