摘要:
1.使用 show session status like '%Com_%'; 可以查看当前连接的各个sql的执行频率 show global status like '%Com_%'; 可以查看从上次mysql服务器启动到目前为止sql的执行频率2.explain select * f... 阅读全文
摘要:
1.使用 show session status like '%Com_%'; 可以查看当前连接的各个sql的执行频率 show global status like '%Com_%'; 可以查看从上次mysql服务器启动到目前为止sql的执行频率2.explain select * f... 阅读全文
摘要:
1.mysql分区处理分区字段NULL值的方式 1.range分区null被当作最小值处理 2.list分区null值必须被枚举出来,否则将出错 3.hash/key分区 null值当作0处理2.RANGE && LIST 分区管理 1.删除分区 alter t... 阅读全文
摘要:
1.hash分区 PS::个人觉得HASH分区很好很强大,简单确分布极其均匀 创建实例: CREATE TABLE HASH_EMP ( tid int, tname char(255) ) PARTITION BY HASH (tid) P... 阅读全文
摘要:
1.RANGE 分区 创建实例: CREATE TABLE EMP ( id int not null primary key auto_increment, name char(25) not null default '' ) PARTITIO... 阅读全文
摘要:
1.一般默认情况下sql_mode默认为空,也就是不严格的sql检查2.如果sql_mode为空的情况下,测试: create table tt3 (name char(2)); //定义一个name字段长度为定长2的tt3表 insert into tt3 values ('wo');... 阅读全文
摘要:
1.尽量使用“绑定参数”功能,php中可用pdo进行一系列操作2.php可使用mysql_real_escape_string()函数进行输入过滤; 阅读全文
摘要:
1. myisam跟memory支持表级别锁定 BDB 页级锁定 Innodb 行级锁定 2.表锁(不是表嫂哈) lock table read //只读表锁,也就是说执行了这个锁后,锁内的操作只能为读操作 select * from ..... unlock... 阅读全文
摘要:
1.所谓触发器,就是指设置好某个表的某个操作(insert ,update ,delete)时候,同时触发的一个操作; 一般用来,比如说删除文章主栏目,那么可以利用触发器删除这个文章栏目下的所有文章2.创建触发器 delimiter $$ create trigger ins_1 ... 阅读全文
摘要:
//Left Join $Blog->table('comment a')->join('reply b on a.id=b.cid')->field('a.*,b.*')->order('id desc')->limit('8')->findall(); //Right Join ... 阅读全文
摘要:
$max){ $index = $i; $max = $array[$i]; } } unset($array[$index]); sort($array); array_push($array2,$max);}pr... 阅读全文
|