Postgresql的隐藏系统列(3)
来源:未知 责任编辑:责任编辑 发表时间:2014-04-20 03:42 点击:次
------+------+------+------+--------+----+--------------
0 | 0 | 1852 | 0 | (0,2) | 2 | kenyonkenyon
0 | 0 | 1852 | 0 | (0,3) | 3 | kenyonkenyon
0 | 0 | 1853 | 0 | (0,4) | 4 | a
0 | 0 | 1854 | 0 | (0,8) | 7 | keke
1 | 1 | 1854 | 0 | (0,9) | 6 | kekeke
2 | 2 | 1854 | 0 | (0,10) | 5 | kenyon_test
0 | 0 | 1856 | 0 | (0,11) | 8 | jackson
这时我们可以看到其实delete的事务ID(xmin)值是1855,insert的(xmin)值是1856,ctid往上累计
最后看一下tableoid和pg_class中oid的关系,(oid不说了,系统中一般设置为false)
postgres=# select tableoid,cmin,cmax,xmin,xmax,ctid,* from test;
tableoid | cmin | cmax | xmin | xmax | ctid | id | name
----------+------+------+------+------+--------+----+--------------
24601 | 0 | 0 | 1852 | 0 | (0,2) | 2 | kenyonkenyon
24601 | 0 | 0 | 1852 | 0 | (0,3) | 3 | kenyonkenyon
24601 | 0 | 0 | 1853 | 0 | (0,4) | 4 | a
24601 | 0 | 0 | 1854 | 0 | (0,8) | 7 | keke
24601 | 1 | 1 | 1854 | 0 | (0,9) | 6 | kekeke
24601 | 2 | 2 | 1854 | 0 | (0,10) | 5 | kenyon_test
24601 | 0 | 0 | 1856 | 0 | (0,11) | 8 | jackson
(7 rows) www.2cto.com
postgres=# select oid,relname,relfilenode,relkind from pg_class where oid = 24601;
oid | relname | relfilenode | relkind
-------+---------+-------------+---------
24601 | test | 24601 | r
作者 kenyon
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>