上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 37 下一页
摘要: 在事务内部用this调用方法(因为事务是通过代码对象实现的) 方法不是public 数据库不支持事务 没有被spring托管 使用了try catch 阅读全文
posted @ 2022-07-06 09:36 howhy 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 方法一: public class threadDemo { public static void main(String[] args) { final Object o=new Object(); final char[] nums="1234567".toCharArray(); final 阅读全文
posted @ 2022-06-27 11:26 howhy 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 索引分类:主键索引 唯一索引 普通索引 外键索引 全文索引 组合索引 索引并不是越多越好,因为索引维护非常麻烦 占用的存储空间比较大,会导致IO增多 聚簇索引:数据和索引存储在一起的 非聚簇索引:数据和索引分开存储的 hash索引:不适合范围查询 二叉树 黑红树 Btree的特点:至少两个分支 数据 阅读全文
posted @ 2022-06-25 09:29 howhy 阅读(31) 评论(0) 推荐(0) 编辑
摘要: mysqladmin extended-status -i 1 -r -uroot -phowhy@123 | grep -i Questions 阅读全文
posted @ 2022-06-23 14:52 howhy 阅读(14) 评论(0) 推荐(0) 编辑
摘要: ##方案1 mysql> set @a:=0; mysql> select @a:=@a+1,name,bb from aa; ##此处需要两次提交并且再次查询 不会从1开始 ##方案2 mysql> select @b:=@b+1 as no ,name,bb from aa,(select @b 阅读全文
posted @ 2022-06-15 18:51 howhy 阅读(222) 评论(0) 推荐(0) 编辑
摘要: ##order by排序的字段若有重复则创建索引时可以加一个唯一索引的字段创建索引 alter table employee add index ind_birth_empno(birth,emp_no) ##分页优化 若limit(limit 10000000,20表示从一千万中取前20条)比较大 阅读全文
posted @ 2022-06-13 17:45 howhy 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 分区类型:range list hash key create table prange(id int primary key)engine=innodb partition by range(id)(partition p0 values less than(10),partition p1 va 阅读全文
posted @ 2022-06-13 14:57 howhy 阅读(23) 评论(0) 推荐(0) 编辑
摘要: create table t_json(content json); insert into t_json values('{"name":"howhy","age":12,"mobile":"1388888888"}'); select json_extract(content,"$.name") 阅读全文
posted @ 2022-06-11 15:03 howhy 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 创建用户:create user 'user1'@'%' identified by 'howhy@123'; 删除用户:drop user 'user1'@'%' ; 查看当前用户权限:show grants; 查看用户权限:show grants for 'user1'@'%'; 给用户授权:g 阅读全文
posted @ 2022-06-08 16:57 howhy 阅读(25) 评论(0) 推荐(0) 编辑
摘要: 读锁:session1:lock table book read; unlock tables; session1可以读book 不可以写book 也不可以读写其它表 session2可以读book 也可以读写其它表 可以写book(但阻塞的需要session1解锁后unlock tables;) 阅读全文
posted @ 2022-06-08 10:01 howhy 阅读(89) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 37 下一页