![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据库
倔强的强哥
这个作者很懒,什么都没留下…
展开
-
mysql幻读的理解
先看下mysql官网的解释 The so-called phantom problem occurs within a transaction when the same query produces different sets of rows at different times. For example, if a SELECT is executed twice, but returns a row the second time that was not returned the first ti原创 2021-01-14 11:50:13 · 201 阅读 · 0 评论 -
mysql优化之in内子查询
遇到的问题 执行下面的语句: select f.id,f.name from father f where id in(select max(id) from father group by name); 前提 id为primary键 name为单列索引 情况 先执行子查询,走索引 再执行外查询,但是外部查询没有走索引,进行了全表扫描 解决方法有 group_concat()构造逗号分隔字符串,但是有1024字节限制 exists 如果左边为大表,还是会全文搜大表 join 具体分析原创 2021-01-14 10:50:46 · 291 阅读 · 0 评论