Incorrect key file for table
收到报警,发现/目录满了,登上服务器一下 果然使用率99%,刚想看看是什么原因,发现/目录又自动恢复到28%查看error.log,发现是由于一条sql排序占用临时表导致空间上涨160621 14:54:55 [ERROR] /usr/sbin/mysqld: Incorrect key file for table '/tmp/#sql_1e4d_0.MYI'; try to repair it160621 14:54:55 [ERROR] Got a...
mysql 联合索引优化
explain select Fid from t_cyou_view_records where Fanchormasterid = 20237 and Froleid = 15081 and Fouttime is null order by Fentertime desc limit 1;+----+-------------+---------------------+------+---------------+------+---------+------+---------+-----------------------------+| id | select_t...
binlog_rows_query_log_events row模式下记录sql语句
mysql 5.7后通过设置binlog_rows_query_log_events为on,可以在binlog_format=row中记录执行的SQL语句。mysql> use mytest;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedmysql> update t1 set name='tt' wh...
innodb_log_file_size设置
innodb_log_file_size的大小设置将会影响MySQL数据库的写入性能,若设置的太小,会增加checkpoint写的次数,以下测试在MySQL5.7版本中的如何修改innodb_log_file_size[root@endb local]# mysqlWelcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 2Server version: 5.7.9-l...
MySQL OOM问题处理一则
一个游戏业务的mysql数据库,多台服务器上mysql服务被OOM,但OOM的原因是什么呢?其实导致OOM的直接原因并不复杂,就是因为服务器内存不足,内核需要回收内存,回收内存就是kill掉服务器上使用内存最多的程序,而mysql服务是使用内存最多,所以就OOM了。首先我们检查是什么原因导致内存不足,这台服务器物理内存为64G# ...
记一条sql优化2
Oracle里的统计信息是非常重要的,统计信息的不正确会使CBO走错误的执行计划,下面就是个例子Plan hash value: 209305330----------------------------------------------------------------------------------------------------------------------------------------------------------------------| Id | Op...