热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

mysql锁的问题

源自innodb技术内幕的一句话,只有当实现本身增加开销时,行级锁才会增加开销,innodb不存在锁升级,一个锁和多个锁的开销是一样的。这里一个锁和多个锁的开销是一样的的意思是:我

源自 innodb 技术内幕的一句话,只有当实现本身增加开销时,行级锁才会增加开销,innodb 不存在锁升级,一个锁和多个锁的开销是一样的。
这里一个锁和多个锁的开销是一样的的意思是:我如果用了多个行锁和一个行锁的开销是一样?这是不是不太符合逻辑?

In the InnoDB transaction model, the goal is to combine the best properties of a multi-versioning database with traditional two-phase locking. InnoDB performs locking at the row level and runs queries as nonlocking consistent reads by default, in the style of Oracle. The lock information in InnoDB is stored space-efficiently so that lock escalation is not needed. Typically, several users are permitted to lock every row in InnoDB tables, or any random subset of the rows, without causing InnoDB memory exhaustion.

->The lock information in InnoDB is stored space-efficiently so that lock escalation is not needed.

-> space-efficiently

大致意思就是行锁开销为 0,n 个行锁开销为 0 * n = 0,这种意思吧。

黑箱知识适度打开,打开多了容易碰见黑洞,耗尽精力也没啥用。很多中文资料看一看就算了,别纠结。


推荐阅读
author-avatar
呼呼小琰琰
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有