mysql插入,更新很慢 [英] Mysql insert,updates very slow
问题描述
我们的服务器数据库在mysql 5.1中 我们的数据库中有754个表.我们为每个项目创建一个表.因此,没有大量的表. 从过去的一周开始,我注意到插入和更新任何表的时间都非常长.如果我创建一个新表并将其插入到表中,则大约需要300分钟才能插入表.
Our server database is in mysql 5.1 we have 754 tables in our db.We create a table for each project. Hence the large no of tables. From past one week i have noticed a very long delay in inserts and updates to any table.If i create a new table and insert into it,It takes one min to insert around 300 recs.
由于我们在同一服务器上的测试数据库有597个表,因此在测试数据库中的插入非常快.
Where as our test database in the same server has 597 tables Same insertion is very fast in test db.
默认引擎为MYISAM.但是INNODB中的表很少.
Default engine is MYISAM. But we have few tables in INNODB .
有一些触发器正在运行.在我删除触发器之后,它变得更快了.但这还不够快.
There were a few triggers running. After i deleted triggers it has become some what faster. But it is not fast enough.
推荐答案
使用 DESCRIBE 了解您的查询执行计划.
USE DESCRIBE to know your query execution plans.
更多信息,请访问 http://dev.mysql.com/doc /refman/5.1/en/explain.html 的用法.
Look more at http://dev.mysql.com/doc/refman/5.1/en/explain.html for its usage.
这篇关于mysql插入,更新很慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!