设为首页 加入收藏

TOP

TRUNCATETABLEHANG(二)
2015-07-24 10:27:41 来源: 作者: 【 】 浏览:7
Tags:TRUNCATETABLEHANG
keys | relfkeys | relrefs | relhasoids | relhaspkey | relhasrules | relhassubclass | relfrozenxid | relacl | reloptions ------------------------+--------------+----------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+------------ ---+---------------+-------------+-------------+---------+------------+----------+-----------+-------------+----------+----------+---------+------------+------------+- ------------+----------------+--------------+--------+------------ cannottruncatetable | 17021 | 11051471 | 17010 | 0 | 23496358 | 0 | 16 | 0 | 11052150 | 0 | 0 | 0 | f | f | r | h | 22 | 0 | 0 | 0 | 0 | 0 | f | f | f | f | 1558793687 | | (1 row) gtlions=# select pg_size_pretty(pg_relation_size('gtlions.cannottruncatetable')); pg_size_pretty ---------------- 512 kB (1 row) gtlions=# select pg_backend_pid(); pg_backend_pid ---------------- 14027 (1 row) gtlions=# select now(); now ------------------------------- 2014-10-15 16:52:25.112906+08 (1 row) gtlions=# truncate table gtlions.cannottruncatetable; Cancel request sent ERROR: canceling statement due to user request gtlions=# select now(); now ------------------------------- 2014-10-15 16:53:39.877717+08 (1 row) ###################On the session 2: During the session 1 running, open new session 2, check the session 1 gtlions=# select procpid,sess_id,usename,current_query,waiting,age(now(),query_start) from pg_stat_activity where procpid=14027; procpid | sess_id | usename | current_query | waiting | age ---------+-----------+---------+-----------------------------------------------+---------+----------------- 14027 | 113747736 | gpadmin | truncate table gtlions.cannottruncatetable; | f | 00:00:49.671096 (1 row) gtlions=# select * from pg_locks where pid=14027; locktype | database | relation | page | tuple | transactionid | classid | objid | objsubid | transaction | pid | mode | granted | mppsessionid | mppiswriter | gp_segment_id ---------------+----------+----------+------+-------+---------------+---------+-------+----------+-------------+-------+---------------------+---------+--------------+ -------------+--------------- relation | 17020 | 11052151 | | | | | | | 1658824590 | 14027 | AccessExclusiveLock | t | 113747736 | t | -1 relation | 17020 | 11051470 | | | | | | | 1658824590 | 14027 | ShareLock | t | 113747736 | t | -1 relation | 17020 | 11051470 | | | | | | | 1658824590 | 14027 | AccessExclusiveLock | t | 113747736 | t | -1 relation | 17020 | 11052150 | | | | | | | 1658824590 | 14027 | ShareLock | t | 113747736 | t | -1 relation | 17020 | 11052150 | | | | | | | 1658824590 | 14027 | AccessExclusiveLock | t | 113747736 | t | -1 transactionid | | | | | 1658824590 | | | | 1658824590 | 14027 | ExclusiveLock | t | 113747736 | t | -1 (6 rows) gtlions=# select procpid,sess_id,usename,current_query,waiting,age(now(),query_start) from pg_stat_activity where procpid=14027; procpid | sess_id | usename | current_query | waiting | age ---------+-----------+---------+-----------------------------------------------+---------+----------------- 14027 | 113747736 | gpadmin | truncate table gtlions.cannottruncatetable; | f | 00:01:03.655322 (1 row) gtlions=# select * from pg_locks where pid=14027; locktype | database | relatio
首页 上一页 1 2 3 4 5 6 下一页 尾页 2/6/6
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇MySQL统计过去12个月的数据(包括.. 下一篇”凉?“的故事

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·C语言中,“指针”用 (2025-12-26 15:20:18)
·在c语言的指针运算中 (2025-12-26 15:20:15)
·C语言-函数指针与函 (2025-12-26 15:20:12)
·求navicat for mysql (2025-12-26 13:21:33)
·有哪位大哥推荐一下m (2025-12-26 13:21:30)