EXPLAIN key_length

varcahr(m) key_len=m*3+2

Read More

关于NULL to NOT NULL

The NULL value means “no data.”

The NULL value can be surprising until you get used to it. Conceptually, NULL means “a missing unknown value” and it is treated somewhat differently from other values.

Read More

Redis INFO输出文本后的编码问题

我们在监控Redis的时候依赖服务的当前的运行状态,Redis相对简易,需要我们自己到INFO里面去抓数据

Read More

自增主键同步差异后的故障切换,自增主键冲突

接上文Replace into 带来的主从自增主键差异后,故障切换后的数据写入冲突

Read More

Replace into 带来的主从自增主键差异

环境

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
CREATE TABLE `t` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`age` int(11) DEFAULT NULL,
`msg` varchar(10) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uniq_age` (`age`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into t (age, msg) values (1,'aaa'),(2,'bbb'),(3,'ccc');
select * from t;
+----+------+------+
| id | age | msg |
+----+------+------+
| 1 | 1 | aaa |
| 2 | 2 | bbb |
| 3 | 3 | ccc |
+----+------+------+
3 rows in set (0.01 sec)

Read More

MongoDB部署

部署位置
{version}参数部分为自动化预留,手动的同学可参考例子

Read More

Redis部署

部署位置
{version}参数部分为自动化预留,手动的同学可参考例子

Read More

UPDATE SYNTAX

今天朋友问mysql的update set的内容是否有顺序问题

Read More

pt-osc工具

pt-osc(pt-online-schema-change的缩写)用于对mysql不锁表的ALTER TABLE操作

Read More

MySQL存储引擎InnoDB

当今主流的MySQL存储引擎是InnoDB

Read More