何谓组合事务ID

Multixacts and Wraparound

Multixact IDs are used to support row locking by multiple transactions. Since there is only limited space in a tuple header to store lock information, that information is encoded as a “multiple transaction ID”, or multixact ID for short, whenever there is more than one transaction concurrently locking a row. Information about which transaction IDs are included in any particular multixact ID is stored separately in the pg_multixact subdirectory, and only the multixact ID appears in the xmax field in the tuple header. Like transaction IDs, multixact IDs are implemented as a 32-bit counter and corresponding storage, all of which requires careful aging management, storage cleanup, and wraparound handling. There is a separate storage area which holds the list of members in each multixact, which also uses a 32-bit counter and which must also be managed.

组合事务用于支持元组被多个事务同时锁定,当多个事务同时并发的锁定了一个元组时,由于元组头部只能记录较为有限的锁信息,锁定同一个元组的多个事务ID被编码为组合事务ID。而具体的哪些事务ID与组合事务ID相关,这部分信息被存放在pg_multixact子目录下,锁定元组的组合事务ID则存放在元组头信息中的xmax字段中。元组头信息中的t_infomask字段与宏定义HEAP_XMAX_IS_MULTI进行与操作即可判定xmax是否为组合事务

define HEAP_XMAX_IS_MULTI 0x1000 /* t_xmax is a MultiXactId */

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值