Community journal

The latest from the MySQL community

Ideas, releases, practical guides, and perspectives from the people building with MySQL.

Follow the feed
Showing entries 1 to 1 of 1 « Previous | Next »
Displaying posts with tag: AutoCreateIndex (reset)
自动生成索引的脚本

本文内容遵从CC版权协议, 可以随意转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明网址: http://www.penglixun.com/tech/database/autocreateindex_script_release.html

写了个自动建索引的脚本,基本原理是解析SQL的条件,然后得出每个条件的运算符,最后通过优先级矩阵将可以建索引的列排序求最长的序列,也就是尽可能把更多的列包含进索引。

使用方法:
./AutoCreateIndex.pl -e “你的SQL”

对于多表连接,务必将列名前跟上表名,否则无法处理,因为脚本并不连接数据库,无法判断哪个列属于那个表。
测试版本,Bug很多,欢迎提供意见。

Note: There is a file embedded within this post, please visit this post to download the file.

[获取更多]