摘要: 工作中遇到一则很奇怪的真实案例,有一个统计sql,统计结果在190 200之间时,耗时基本上维持在1.6S,统计结果在此数据范围外的统计耗时,基本上维持在0.1 0.3S之间, 按照惯例,explain查看执行计划。 为方便阐述,约定如下 : 数据范围在190 200,耗时1.6S的叫 sql1,数 阅读全文
posted @ 2018-07-26 00:02 Jandison 阅读(306) 评论(0) 推荐(0) 编辑
摘要: master存活的状态下切换 masterha_master_switch --conf=/etc/masterha/app1.cnf --master_state=alive --new_master_host=192.168.0.101 --orig_master_is_new_slave -- 阅读全文
posted @ 2017-11-07 16:29 Jandison 阅读(6319) 评论(0) 推荐(0) 编辑
摘要: redis-benchmark是redis官方提供的压测工具,安装好redis后,默认安装。使用简便。 语法: Usage: redis-benchmark [-h <host>] [-p <port>] [-c <clients>] [-n <requests]> [-k <boolean>] 模 阅读全文
posted @ 2017-08-10 09:23 Jandison 阅读(1976) 评论(0) 推荐(0) 编辑
摘要: group replication是一种全新的高可用,高扩张的MySQL集群服务。高一致性,基于原生复制及paxos协议的组复制技术,以插件方式提供一致数据安全保证;高容错性,大多数服务正常就可继续工作,自动不同节点检测资源征用冲突,按顺序优先处理,内置自动防脑裂机制;高扩展性,自动添加移除节点,并 阅读全文
posted @ 2017-07-30 21:48 Jandison 阅读(432) 评论(0) 推荐(0) 编辑
摘要: MySQL · 特性分析 · 优化器 MRR & BKA 上一篇文章咱们对 ICP 进行了一次全面的分析,本篇文章小编继续为大家分析优化器的另外两个选项: MRR & batched_key_access(BKA) ,分析一下他们的作用、原理、相互关系、源码实现以及使用范围。 什么是 MRR MRR 阅读全文
posted @ 2017-06-30 09:43 Jandison 阅读(442) 评论(0) 推荐(0) 编辑
摘要: 方法一:convert(float,字段名) as 别名 select convert(float,round(10.123232,2)) 结果:10.12 select convert(float,round(10,2)) 结果:10 方法二:cast(round(字段名,2) as numeri 阅读全文
posted @ 2017-06-29 16:04 Jandison 阅读(2105) 评论(0) 推荐(0) 编辑
摘要: 1. 安装SVN服务器: 检查是否已安装 安装SVN服务器 验证安装 查看版本 2. 代码库创建: 安装完成后要建立SVN库 执行后,自动建立repositories库,查看/opt/svn/repositories文件夹包含了conf,db,format,hooks,locks,README.tx 阅读全文
posted @ 2017-06-28 10:28 Jandison 阅读(168) 评论(0) 推荐(0) 编辑
摘要: [root@wfm ~]# yum -y install pip Loaded plugins: fastestmirror, refresh-packagekit, securityLoading mirror speeds from cached hostfile* base: mirrors. 阅读全文
posted @ 2017-06-27 09:49 Jandison 阅读(472) 评论(0) 推荐(0) 编辑
摘要: 二进制日志是写操作是,首先写入二进制日志缓冲(binlog_cache)然后commit,再从binlog_cache写入到binlog文件,默认大小为32K,而binlog_cache是session级别的,也就是说实际binlog cache占用内存数= connections * binlog 阅读全文
posted @ 2017-06-21 16:49 Jandison 阅读(2504) 评论(0) 推荐(0) 编辑
摘要: Antelope和Barracuda均为innodb存储引擎的文件格式,Antelope为默认格式,非压缩;Barracuda为压缩格式;两者主要的不同在于对大数据量的存储时所占用的空间差异。若要使用innodb的压缩功能,则必须使用innodb_file_format=Barracuda,不然没有 阅读全文
posted @ 2017-06-21 15:33 Jandison 阅读(838) 评论(0) 推荐(0) 编辑