![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
sql
vickyhwj
这个作者很懒,什么都没留下…
展开
-
查看那些行被锁
mysql:SELECT * from performance_schema.data_locks;oracle:select p.spid,a.serial#, c.object_name,b.session_id,b.oracle_username,b.os_user_name from v$process p,v$session a, v$locked_object b,all_objects c where p.addr=a.paddr and ...原创 2021-12-07 15:13:54 · 381 阅读 · 0 评论 -
jpa乐观锁
创建SingleTableEntityPersister时会调用generateUpdateString生成updateSql,update ACT_HI_ACTINST set xxxx where ID_=? and REV_=?update完之后commit时,会调用getNextVersion调用Versioning.increment( entry.getVersion(), persister.getVersionType(), event.getSession() ...原创 2021-11-18 15:54:58 · 173 阅读 · 0 评论 -
可重复读的MVCC
6查到的是旧数据,假如3不是select语句,6查出来的是4update后的数据,因为ReadView是在发起第一次查询的时候创建的原创 2021-04-13 21:55:37 · 112 阅读 · 0 评论 -
mysql8锁表情况
https://www.cnblogs.com/gered/p/12769367.html原创 2021-03-15 08:46:37 · 1028 阅读 · 0 评论 -
sql临时表应用
https://blog.csdn.net/weixin_30378311/article/details/98842269(一般只在确定不能用索引的时候才使用临时表,或者在存储过程中某些固定数据使用次数非常多的时候使用临时表,其他时候我一般不建议使用)...原创 2021-03-09 15:47:31 · 67 阅读 · 0 评论 -
mysql索引和数据页的关系
https://blog.csdn.net/luoyang_java/article/details/92781164原创 2021-02-07 21:22:43 · 904 阅读 · 0 评论 -
limit测试
explainselect sql_no_cache * from record order by regtime asc limit 20000,30;explainselect sql_no_cache r.* from record r join (select id from record order by regtime asc limit 20000,30) t on ...原创 2018-11-13 16:27:08 · 238 阅读 · 0 评论 -
group by后在排序
https://www.cnblogs.com/devzxd/p/mysql-groupby-orderby.html转载 2018-08-04 09:48:10 · 8875 阅读 · 0 评论 -
mysql锁机制
手动增加表锁lock table 表名字 read(write),表名字2 read(write),其他;查看表上加过的锁show open tables;解锁unlock tablesMyISAM在执行查询语句前,会自动给涉及的所有表加上读锁,在执行增删改前会给涉及的所有表加上写锁。show STATUS like 'table%'查看事务隔离原创 2017-11-24 22:56:04 · 110 阅读 · 0 评论 -
mysql的事务详解
http://blog.csdn.net/mevicky/article/details/50332443转载 2017-11-16 19:49:57 · 166 阅读 · 0 评论 -
mysql事务隔离级别
http://blog.csdn.net/z69183787/article/details/52219974转载 2017-11-21 22:48:40 · 99 阅读 · 0 评论 -
sql(join带代替in)
EXPLAIN SELECT count(*)FROM empWHERE depid not IN( SELECT depidFROM depWHERE dname ='bLByMr' or dname = 'pyuDKO')EXPLAIN SELECT count(*)FROM emp join dep on emp.depid=dep.depidWH原创 2017-11-16 16:36:22 · 6675 阅读 · 0 评论 -
sql优化日记2(join代替in)
EXPLAINSELECT count(*)FROM empWHERE EXISTS (SELECT *FROM dep WHERE dep.depid=emp.depid)EXPLAINSELECT count(*)FROM empWHERE depid in (SELECT depidFROM dep )EXPLAIN原创 2017-11-16 16:21:26 · 492 阅读 · 0 评论 -
sql语句优化日记1
EXPLAIN SELECT(SELECT COUNT(*)FROM empWHERE depid =(SELECT depidFROM depwhere dname='lnHwlS' ))+(SELECT COUNT(*)FROM empWHERE depid =(SELECT depidFROM depwhere dname='thJHs原创 2017-11-16 15:47:06 · 134 阅读 · 0 评论 -
explain详解
http://www.cnitblog.com/aliyiyi08/archive/2008/09/09/48878.html转载 2017-11-16 00:12:33 · 269 阅读 · 0 评论 -
Hibernate中对象的三种状态及相互转化
http://blog.csdn.net/fg2006/article/details/6436517转载 2017-11-19 22:54:02 · 159 阅读 · 0 评论 -
spring事务
http://blog.csdn.net/yuanlaishini2010/article/details/45792069转载 2017-11-19 21:27:57 · 131 阅读 · 0 评论 -
EXISTS的应用
CREATE TABLE `user` ( `uid` int(11) NOT NULL, `uname` varchar(10) DEFAULT NULL, PRIMARY KEY (`uid`)) ENGINE=InnoDB DEFAULT CHARSET=utf8CREATE TABLE `role` ( `rid` int(11) NOT NULL,原创 2017-10-29 20:07:22 · 231 阅读 · 0 评论