
1
目录
SQL 优化 .................................................................................................................................................................................................................... 3
数据库优化 ............................................................................................................................................................................................................... 6
DB&SQL 优化 ............................................................................................................................................................................................................ 7
索引 ................................................................................................................................................................................................................... 8
分库分表分区 ................................................................................................................................................................................................... 8
数据库引擎 ....................................................................................................................................................................................................... 9
预处理 ............................................................................................................................................................................................................... 9
mysql like 查询 ................................................................................................................................................................................................ 9
读写分离 ........................................................................................................................................................................................................... 9
MySQL 事物 ............................................................................................................................................................................................................... 9
一、事务定义 ................................................................................................................................................................................................... 9
二、转账操作理解事务 ................................................................................................................................................................................... 9
三、事务四大特征(ACID) ............................................................................................................................................................................... 10
四、关于事务的一些术语 ............................................................................................................................................................................. 10
五、和事务相关的两条重要的 SQL 语句(TCL).............................................................................................................................................. 10
六、事务开启的标志?事务结束的标志? .................................................................................................................................................. 10
七、事物与数据库底层数据 ......................................................................................................................................................................... 10
八、在 MySQL 中,事务提交与回滚 ............................................................................................................................................................ 10
九、事务四大特性之一隔离性(isolation) ..................................................................................................................................................... 11
十、隔离级别与一致性关系 ......................................................................................................................................................................... 12
十一、设置事务隔离级别 ............................................................................................................................................................................. 12
十二、隔离级别的作用范围 ......................................................................................................................................................................... 12
十三、查看隔离级别 ..................................................................................................................................................................................... 12
DB 索引 ................................................................................................................................................................................................................... 13
MySQL 索引的类型 ......................................................................................................................................................................................... 13
索引原理 ......................................................................................................................................................................................................... 13
Mysql 索引管理 .............................................................................................................................................................................................. 14
索引的两大类型 hash 与 btree 比较 ............................................................................................................................................................. 15
索引原则 ......................................................................................................................................................................................................... 15
索引无法命中 ................................................................................................................................................................................................. 15
慢查询 ............................................................................................................................................................................................................. 16
DB 锁 ....................................................................................................................................................................................................................... 17
乐观锁悲观锁 ......................................................................................................................................................................................................... 17
JVM 内存结构 ......................................................................................................................................................................................................... 19
内存结构 ......................................................................................................................................................................................................... 19
Java 堆 ............................................................................................................................................................................................................. 20
JVM GC 过程 ........................................................................................................................................................................................................... 20
GC 执行机制(回收器) ........................................................................................................................................................................................ 21
JVM 判断对象是否可以被回收算法 ...................................................................................................................................................................... 22
1.1 引用计数法 .............................................................................................................................................................................................. 22
1.2 根搜索算法 .............................................................................................................................................................................................. 22
回收算法 ................................................................................................................................................................................................................. 22
标记-清除算法(Mark-Sweep) .................................................................................................................................................................... 22
复制算法(Copying) .................................................................................................................................................................................... 23
标记-整理算法(Mark-Compact) ................................................................................................................................................................ 23