本地临时表的默认锁定粒度 - Microsoft SQL Server 2000
MSSQL 中本地临时表的锁定粒度是多少?鉴于本地临时表对于会话而言是本地的,并且会话与MSSQL2K中的连接相同,并且无法通过TSQL或其他方式在同一连接上并行执行任何语句或其他代码(我相信),那么直观上,数据库应该在表的生命周期内持有独占表锁。这将避免锁定内存使用和锁定升级。我在任何地方都无法得到明确的答案。是这样吗?
What is the locking granularity used for local temp tables in MSSQL? Given that local temp tables are local to sessions, and sessions are the same as connections in MSSQL2K, and that there is no way to execute any statements or other code in parallel on the same connection through TSQL or other means (I believe), then intuitively the DB should just hold an exclusive table lock for the lifetime of the table. This would avoid locking memory usage and locking escalation. I can't get a clear answer on this anywhere. Is this the case?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
# 临时表只是一个表,但位于 tempdb 中。由于它是表,因此适用相同的锁定粒度。
A # temp table just a table, but sits in tempdb. The same locking granularity applies because it is a table.