2014年2月19日

MySQL里执行SHOW INDEX结果中Cardinality的含义

摘要: 今天在写一个Perl脚本,想自动化查找出MySQL数据库中可能无效的索引,于是根据朝阳的书上提到的一些规则,我来设计了一些判断方法,其中发现某个我想要的值就是SHOW INDEX FROM table里的Cardinality,于是查了下它的含义以验证我的想法。MySQL中SHOW INDEX FROM table 会有以下结果列| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comme 阅读全文

posted @ 2014-02-19 22:56 Still water run deep 阅读(3115) 评论(0) 推荐(0) 编辑

innodb_force_recovery

摘要: WarningBefore using innodb_force_recovery ensure that you have a backup copy of your database in case you need to start over. You should always begin by setting innodb_force_recovery to a lower value. Incrementally increase the setting as required. Only use an innodb_force_recovery setting of 3 or g 阅读全文

posted @ 2014-02-19 22:09 Still water run deep 阅读(639) 评论(0) 推荐(0) 编辑

SELECT LOCK IN SHARE MODE and FOR UPDATE

摘要: Baronwrotenice article comparing locking hints in MySQL and SQL Server.In MySQL/Innodb LOCK IN SHARE MODE and SELECT FOR UPDATE are more than hints. Behavior will be different from normal SELECT statements. Here is simple example: 1 SESSION1: 2 mysql> begin; 3 Query OK, 0 rows affected (0.00 sec) 阅读全文

posted @ 2014-02-19 01:25 Still water run deep 阅读(393) 评论(0) 推荐(0) 编辑

To pack or not to pack – MyISAM Key compression

摘要: MyISAM storage engine has key compression which makes its indexes much smaller, allowing better fit in caches and so improving performance dramatically. Actually packed indexes not a bit longer rows is frequent reason of MyISAM performing better than Innodb. In this article I’ll get in a bit more de 阅读全文

posted @ 2014-02-19 00:04 Still water run deep 阅读(326) 评论(0) 推荐(0) 编辑

导航