从跟上理解Mysql
http://itrailflow.com/how_mysql_runs.html
1.基本语句
2.replace into 和insert into on duplicate key的区别
https://blog.csdn.net/zyb2017/article/details/78449910
3.left join right join inner join
https://blog.csdn.net/hj7jay/article/details/51749863#commentBoxs
4.mysql行锁 表锁
MySQL表级锁与行级锁
https://cloud.tencent.com/developer/article/1353609
全面了解mysql锁机制(InnoDB)与问题排查
https://juejin.im/post/5b82e0196fb9a019f47d1823#heading-7
5.浅析MySQL InnoDB的隔离级别
https://juejin.im/post/5c3d95c0e51d452c8e6d30f0
6.mysql事物隔离级别
https://juejin.im/post/5ba0c3a6e51d450e597b2fb4
对于前者, 只需要锁住满足条件的记录,不可重复读:
但不可重复读重点在于update/delete,而幻读的重点在于insert。
对于后者, 要锁住满足条件及其相近的记录
7.索引:
互联网公司面试必问的mysql题目(上下)
https://juejin.im/post/5ba1f32ee51d450e805b43f2
8.MySQL主从复制原理
https://juejin.im/post/5ca2a176f265da30ba5b0b91
饿汉式单例
public class Singleton {
private static Singleton singleton = new Singleton();
private Singleton(){}
public static Singleton getInstance(){
return singleton;
}
}
懒汉式单例
public class Singleton {
private static Singleton singleton;
private Singleton(){}
public static synchronized Singleton getInstance(){
if(singleton==null){
singleton = new Singleton();
}
return singleton;
}
}
/**
* 静态内部类,使用双重校验锁,线程安全【推荐】
*/
public static class Singleton7 {
private volatile static Singleton7 instance = null;
private Singleton7() {
}
public static Singleton7 getInstance() {
if (instance == null) {
synchronized (Singleton7.class) {
if (instance == null) {
instance = new Singleton7();
}
}
}
return instance;
}
}
数据库性能慢查询优化底层索引原理
https://tech.meituan.com/2014/06/30/mysql-index.html
mysql写入速度优化参数及原理:
http://www.notedeep.com/note/38/page/581