我在慢查询日志中有很多条目,上面只有“COMMIT”,它们大约需要 3 秒,与其他一些查询相比,这很慢但并不可怕。
条目如下所示:
COMMIT;
# Time: 120111 14:11:05
# User@Host: root[root] @ localhost []
# Query_time: 3.140228 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
SET timestamp=1326291065;
COMMIT;
# Time: 120111 14:14:03
# User@Host: root[root] @ localhost []
# Query_time: 2.036250 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
SET timestamp=1326291243;
COMMIT;
我的问题是为什么 Rails 会发出“COMMIT”?
我的理解是它应该使用自动提交,除非我手动进行交易。