VirtualBox 上的 Windows XP 上的 Mysql 非常慢

VirtualBox 上的 Windows XP 上的 Mysql 非常慢

For flyway (http://code.google.com/p/flyway) CI integration tests on Jenkins (Ubuntu) we use a Windows XP image on VirtualBox 4.1 on which the the supported DBs (DB2, MySQL, PostgreSQL, Oracle, SQLServer) are installed. Everything works fine and we connect via virtualbox port forwarding feature to the DBs on the virtual machine.

But only for MySQL the simple test's run extremely slow (minutes instead of several seconds) and we had to raise the timeout to get them green.

如果使用本地 MySQL 实例,测试运行速度会很快。

有人知道这可能是什么原因吗,或者我们如何跟踪/分析这个问题?

问候克里斯

答案1

  • 主机和客户机上的表是否采用相同的格式(MyISAM、InnoDB 等)?
  • 两台机器上创建的表的索引是否相同?尝试EXPLAIN <query>在 mysql 控制台中运行以查看和比较结果,尤其是当两个查询使用相同的索引且顺序相同时。
  • 您使用子查询吗?它们有时会非常慢。如果使用子查询,请尝试使用JOINs 重写它们。
  • 查看配置文件 (my.ini / my.cnf) 并检查设置是否相同。特别查看临时表/缓冲区大小和诸如此类的内容。可能存在 MySQL 可用内存量较少的情况。

相关内容