本文介绍了Postgres pgadmin工具中TX和XID分数代表什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

XID和TX列中的分数代表什么.这是postgres的pgadmin工具的屏幕截图.

What does the fractions in column XID and TX stand for. This is a screenshot of the postgres's pgadmin tool.

我知道TX和XID分别表示事务和事务ID,但是我不明白分数符号的含义.

I understand that TX and XID mean transaction and transaction ID respectively, however I don't understand what the fraction notation means.

推荐答案

虚拟事务ID为"n/nnnn"格式.实际的XID只是整数.虚拟xid的第一部分是每个连接唯一的后端标识符.第二部分是该连接的后端为其交易分配的临时交易ID.

Virtual transaction IDs have the "n/nnnn" format. Real XIDs are just integers. The first part of the virtual xid is a backend identifier that's unique to each connection; the second part is a temporary transaction id assigned by that connection's backend for its transactions.

有关详细信息,请参见src/include/storage/lock.hVirtualTransactionId的定义.

See the definition of VirtualTransactionId in src/include/storage/lock.h for details.

这些列似乎与pg_locks中的virtualxid和/或transactionidvirtualtransaction列相对应.参见文档.

Those columns appear to correspond to the virtualxid and/or transactionid and virtualtransaction columns in pg_locks. See the docs.

如果我说的没错,那么:

If I'm correct in that then:

  • "TX"是持有或等待锁定的交易的虚拟交易ID.
  • "XID"是等待交易所针对的交易的虚拟交易ID(如果目标是虚拟xid).在PgAdmin中,如果它是正常的xid,它也可能会显示目标的xid.

虚拟事务ID是PostgreSQL在事务开始时分配给每个事务的临时瞬态事务ID.它们没有记录在磁盘上.仅当事务执行需要对磁盘进行事务性写入的操作时,才分配实际xid.

Virtual transaction IDs are temporary, transient transaction IDs that PostgreSQL allocates to every transaction at transaction start. They aren't recorded on disk. A real xid is only allocated when the transaction does something that requires a transactional write to disk.

根据链接的手册:

这篇关于Postgres pgadmin工具中TX和XID分数代表什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 10:44