as i prepare to convert some mysql tables with fulltext indexes from myisam to innodb i want to verify that running a standard production query set against the tables will return the same results with innodb that it did with myisam. since i read matt lord’sblog postabout the document relevancy rankings used for innodb full-text searches i knew to expect some differences when sorting by relevancy, so i want to focus on getting the same set of rows back, mostly ignoring the order in which the rows are returned.
Percona toolkit has a tool calledpt-upgradethat works well for this purpose. I used 2 test servers with a copy of my production database. On one of the servers I left the tables in MyISAM, and on the other I converted the tables to InnoDB. I copied a slow query log from a production host running withlong_query_time=0to get the query set for testing. Since I was only interested in queries on a few tables, rather than running the entire slow query log against the servers I just extracted the specific queries I was interested in and ran them as a raw log.
Here’s the command I used:
<code>pt-upgrade --read-only /--database flite /--type rawlog /tmp/proddb-slow.log.raw /h=testdb33.flite.com /h=testdb47.flite.com</code> 登录后复制 |
I used the--read-onlyflag sopt-upgradewould only executeSELECTstatements, and not any statements that modify data.
Since I extracted the SQL queries from the slow query log instead of using the full slow query log, I used--type rawloginstead of the default of--type slowlog.
For the two hosts I compared, testdb33 is using FULLTEXT on InnoDB, and testdb47 is using FULLTEXT on MyISAM.
When I ranpt-upgradeit exposed several significant discrepancies. I will document those discrepancies and how I fixed them in a future post.
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号