Design by decomposition
Database Normalization
- "Mega" relations + properties of the data
- System decomposes based on properties
- Final set of relations satisfies normal form
- No anomalies, no lost information
-
Functional dependencies => BCNF
-
Multivalued Dependency => 4NF
另外 Decomposition 必须满足 loseless join
Functional Dependency
Functional Dependency 非常通用,随便举几例
- Relational design by decomposition (BCNF)
- 数据存储时压缩
- 查询时优化
key:能决定一个 relation 所有元素的元素集合
closure:给定的元素集合所能决定的所有元素
由 closure 求得 key:
考虑 relation 的所有集合(由集合大小从小到大考虑),利用 colsure 找到那些能决定 relation 所有元素的集合
BCNF
Multivalued Dependency
4NF Decomposition
Denormalization
当然不是分解的越小越好,也要看情况。。。感觉这就是个经验问题。