4

I have three large MySQL tables. They are approaching 2 million records. Two of the tables are InnoDB and are currently around 500 MB in size. The other table is MyISAM and is about 2.5 GB.

We run an import script from FileMaker to insert and update records in these tables but lately it has become very slow - only inserting a few hundred records per hour.

What can I do to increase performance to make inserts and updates happen faster?

4

4 回答 4

2

从命令行在 MySQL 上执行时查询是否慢?

如果您使用Execute SQLFileMaker 中的脚本步骤,每次调用后都会连接和断开连接,从而在执行大量查询时导致严重减慢。我们已经让客户切换到我们的JDBC 插件(此处为自我推销免责声明)以避免这种情况,从而大大提高了速度。

于 2010-12-19T00:35:48.870 回答
2

对于 Innodb 表,如果它是可接受的风险,我会考虑更改innodb_flush_log_at_trx_commit级别。这篇博文中的更多细节,以及更多 Innodb 调优指针。

对于这两个引擎,INSERT将 s 组合在一起可以加快速度。见文档

你运行的是什么版本的 MySQL?新的 InnoDB“插件”引擎和具有多个处理器的服务器上的操作并发性有了许多改进。

于 2010-12-07T22:34:29.060 回答
2

For INSERT it could have to do with the indexes you have defined on the tables (they have to be updated after each INSERT). Could you post more information about them? And are there triggers set on the tables?

For UPDATE it is a different story, it could be that not the record update is slow but finding the record is slow. Could you try to change the UPDATE into a SELECT and see if it is still slow? If yes, then you should investigate your indexes.

于 2010-12-07T22:32:25.800 回答
0

事实证明,缓慢的原因来自 FileMaker 方面。将 FileMaker 记录导出到 CSV 并运行 INSERT/UPDATE 命令导致执行速度非常快。

于 2011-02-05T01:27:30.443 回答