事务 Transaction

- 和事务相关的 SQL 语句只有 DML 语句(insert、delete、update)
- 事务特性:ACID
- A:原子性,事务是最小单元,不可再分
- A:一致性,事务必须保证多条DML语句同时成功或者同时失败
- A:隔离性,事务之间是隔离的

- A:持久性,事务成功提交,数据必须持久化到硬盘文件中
索引:相当一本书的目录,快速找到对应的资源。
-
主键和具有unique约束的字段自动添加索引
-
不加索引就是全表扫描
-
添加索引,效率很高,但是要根据具体使用场景
- 数据量庞大
- 该字段很少有 DML 操作
- 该字段经常出现在 where 字句中

-
创建、删除索引

-
索引分类

-
索引失效

-
有无索引比较

-
索引原理

视图 view
- 创建、删除视图

- 对视图进行CRUD会影响原表数据

- 作用

Mysql 的事务、索引和视图
原文:https://www.cnblogs.com/lq-404/p/15251640.html