01课程简介
p02 mysql简介
p03rpm安装
先在官网下载rpm安装包
查看是否安装过
安装
查看是否安装成功
service mysql start 启动mysql
service mysql stop 停止mysql
p04 root密码设置和开机启动
p05 安装位置![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/0d14bfe0f756ea675b591223a685632b.png)
p06修改字符集
p07mysql配置文件
p08 mysql逻辑架构简介
p14 索引是什么
p15 索引优势劣势
p16索引分类
p17索引结果与检索原理
p18 哪些情况适合建立索引
p19不适合建索引情况
p20 性能分析前提知识
p21 explain使用简介
explain+sql语句
p22explain之id介绍
第一种
第二种
第三种
p23explain之select_type和table介绍
table显示数据是关于哪张表的
p24 explain之type介绍
type类型
p25 explain之possible_key与key
p26explain之key_len介绍
p27explain之ref介绍
p28explain之rows介绍
rows:每张表有多少行被优化器查询
建完索引后,rows降低了
p29explain之extra介绍
总体
using filesort
优化前后对比
using temporary
using index (正常)
p30explain之热身Case
p31 索引单表优化案例
第一次没有索引
第二次建立了三个字段的复合索引
范围查询会导致索引失效
优化办法: 删除原来索引 创建新的2个字段的复合索引
p32 两表优化案例
结论:左外级联 右表添加索引, 右外级联 左表添加索引
p33 索引三表优化案例
p34 索引优化
最左匹配原则:
p35 索引优化2
p36 索引优化3
p37索引优化4
p38 索引优化5
p39 索引优化6
p40 索引优化7
想要使用左边%开始的模糊查询,又索引不失效,使用覆盖索引,即 查询的字段个数和顺序 和 建立的索引个数顺序保持一致
p41 索引优化8
p52 表锁 读锁案例讲解
加读锁
lock table mylock read;
p53 写锁案例讲解
加写锁
lock table mylock write;
释放锁
unlock tables;
查看哪些表被加锁了
show open tables;
p54 行锁理论
p55 行锁讲解
p57 索引失效行锁变表锁
p58 间隙锁危害
P59如何锁定一行
select xxx … for update 锁定某一行后,其他事务操作这行会被阻塞
p60 行锁总结
行锁优化建议