![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据库
justinsun221
这个作者很懒,什么都没留下…
展开
-
mysql 锁
msyql 锁 读锁 写锁 锁的粒度:Innodb 到行,MyIsam 到表 查看当前表是否加锁: show open tables; 给指定表orders 和order_details 分别加读锁和写锁: lock table orders read, order_details write 解锁所有表: unlock tables; 总而言之,读锁会阻塞写,但是不会堵塞读,而写锁则会把读和写都阻塞 ...原创 2020-10-29 17:50:09 · 44 阅读 · 0 评论 -
Mysql性能调优
MySQL 性能调优: 主要表现: 1. 执行时间长。 2. 等待时间长。 优化方向: 1. 查询语句写的烂 2.索引失效,索引包括单索引和符合索引,优化where 条件之后字段 3.关联查询太多join(设计缺陷和或不得已的需求) 4. 服务器调优几各个参数设置(缓冲和线程数等) 查询 手写:Select * From table where xx group by xxx having xxx order by xxx limit 机读:From xx where xx group by原创 2020-10-27 17:07:57 · 236 阅读 · 0 评论 -
Mysql Join 类型汇总
1. SELECT * from stu inner join score on stu.id = score.stu_id; 2. select * from stu left join score on stu.id = score.stu_id 3. select * from stu right join score on stu.id = score.stu_id 4. select * from stu left join score on stu.id = score.stu.原创 2020-10-26 14:28:56 · 225 阅读 · 0 评论