gpt4 book ai didi

mysql - MySQL VIEW 的锁定行为?

转载 作者:行者123 更新时间:2023-11-29 00:56:02 24 4
gpt4 key购买 nike

我们正在考虑在我们的应用程序中使用 MySQL 合并 View ,并在文档中遇到以下令人费解的语言:

A reason to choose TEMPTABLE explicitly is that locks can be released on underlying tables after the temporary table has been created and before it is used to finish processing the statement. This might result in quicker lock release than the MERGE algorithm so that other clients that use the view are not blocked as long.

我阅读这篇文章的方式是,在合并 View 上进行选择会取消读取锁定,但这似乎不对。两个客户端能否像读取表一样同时读取 View ?

谢谢!

最佳答案

如果您在 MyISAM 表上创建 View ,SELECT 和 UPDATE 是互斥的,因此表上的 SELECT/UPDATE 将阻止 View 上的任何 UPDATE/SELECT。因此,您希望保持简短的锁定。

在 InnoDB 上,这不是问题。

关于mysql - MySQL VIEW 的锁定行为?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6077212/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com