我可以在MySQL/InnoDB中关闭事务吗? [英] Can I turn transactions off in MySQL/InnoDB?

查看:400
本文介绍了我可以在MySQL/InnoDB中关闭事务吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Django应用,其中InnoDB中的默认"REPEATABLE READ"事务隔离级别导致不同的进程对数据的视图与数据库中的视图不同.

I have a Django app where the default "REPEATABLE READ" transaction isolation level in InnoDB is causing different processes to have different views of the data than that current in the database.

例如流程1进行了更改,但流程2没有看到它.

e.g. Process 1 has made a change but Process 2 isn't seeing it.

我不需要应用程序中的交易完整性;我可以完全关闭事务,以便所有执行SELECT的进程都看到相同的数据吗?

I don't need transactional integrity in the app; can I just turn off transactions altogether so that all processes doing a SELECT see the same data?

这样做有什么缺点吗?

这是读未提交"的意思吗?

Is this what is meant by "READ UNCOMMITTED"?

欢迎任何指针 雷切尔(Rachel)

Any pointers welcome Rachel

推荐答案

我建议您将InnoDB表转换为myISAM.如果您的标准是速度,那么您将通过使用面向事务的表类型(InnoDB)浪费大量潜力,而只是禁用事务.如果您只是将表转换为myISAM,将会获得很多收益.它的设计考虑了缺乏事务,同时仍然能够锁定更改(即表锁定).

I'd suggest that you just convert the InnoDB tables to myISAM. If your criteria is speed, you are wasting alot of potential by using a transaction oriented table type (InnoDB) and just disabling transactions. You would gain alot if you just converted the tables to myISAM. It's designed with lack of transactions in mind, while still being able to lock changes (i.e. table locks).

干净

ALTER TABLE table_name ENGINE = MyISAM;

可以为单个表提供技巧,转储,更改类型和加载表也可以实现技巧.

can do the trick for a single table, dumping, changing type and loading the table does the trick as well.

这篇关于我可以在MySQL/InnoDB中关闭事务吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆