Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7521fc3

Browse files
表的范式化和反范式化
1 parent d74da06 commit 7521fc3

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
group by 会使用临时表 增加I/O操作,降低查询效率
2+
3+
4+
反范式化:为了查询效率的考虑,把原本符合第三范式的表适当增加冗余,
5+
以达到优化查询效率的目的。以空间换取时间的操作
6+
7+
反范式化:就是做的事情和范式化是反着来的,目的也很简单,以空间换时间、简化编程的复杂度,
8+
实际的效果就是编写的SQL语句更加的简单了,并且对应的SQL语句的执行效率也更加的高了!
9+
10+
11+
12+
13+
14+
15+
16+

‎数据库结构优化/表的范式化

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
表的范式化即数据库设计的规范化:数据表不存在非关键字段对任意关键字段的传递函数依赖,则符合第三范式。
2+
可以将一张数据表进行拆分,来满足第三范式的要求。
3+
设计表的时候符合范式化是为了:减少数据冗余、减少表的插入、更新、删除异常
4+
设计表的时候使用反范式化是为了:以空间换时间、增强代码的可编程性和可维护性
5+
不符合第三范式要求的表存在以下问题:
6+
1.数据冗余:(分类、分类描述)对于每一个商品都会进行记录
7+
2.数据插入异常
8+
3.数据更新异常
9+
4.数据删除异常

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /