TRUNCATETABLEHANG(四)

2015-07-24 10:27:41 · 作者: · 浏览: 20
的Location在爱尔兰,这会估计人家正在休息,只好自己继续摸索:

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 |      |       |               |         |       |          |  1662808322 | 14027 | AccessExclusiveLock | t       |    113747736 |
 t           |            -1
 transactionid |          |          |      |       |    1662808322 |         |       |          |  1662808322 | 14027 | ExclusiveLock       | t       |    113747736 |
 t           |            -1
 relation      |    17020 | 11051470 |      |       |               |         |       |          |  1662808322 | 14027 | ShareLock           | t       |    113747736 |
 t           |            -1
 relation      |    17020 | 11051470 |      |       |               |         |       |          |  1662808322 | 14027 | AccessExclusiveLock | t       |    113747736 |
 t           |            -1
 relation      |    17020 | 11052150 |      |       |               |         |       |          |  1662808322 | 14027 | ShareLock           | t       |    113747736 |
 t           |            -1
 relation      |    17020 | 11052150 |      |       |               |         |       |          |  1662808322 | 14027 | AccessExclusiveLock | t       |    113747736 |
 t           |            -1
(6 rows)
 
gtlions=# select * from pg_locks where relation='gtlions.cannottruncatetable'::regclass;
 locktype | database | relation | page | tuple | transactionid | classid | objid | objsubid | transaction |  pid  |        mode         | granted | mppsessionid | mppi
swriter | gp_segment_id
----------+----------+----------+------+-------+---------------+---------+-------+----------+-------------+-------+---------------------+---------+--------------+-----
--------+---------------
 relation |    17020 | 11051470 |      |       |               |         |       |          |  1662808322 | 14027 | ShareLock           | t       |    113747736 | t   
        |            -1
 relation |    17020 | 11051470 |      |       |               |         |       |          |  1662808322 | 14027 | AccessExclusiveLock | t       |    113747736 | t   
        |            -1
 relation |    17020 | 11051470 |      |       |               |         |       |          |  2653373155 | 15567 | AccessExclusiveLock | f       |    113747736 | t   
        |             0
 relation |    17020 | 11051470 |      |       |               |         |       |          |           0 | 13773
| AccessShareLock | t | 75284454 | f | 0 relation | 17020 | 11051470 | | | | | | | 2653366790 | 15569 | AccessExclusiveLock | f | 113747736 | t | 1 relation | 17020 | 11051470 | | | | | | | 0 | 13789 | AccessShareLock | t | 75284454 | f | 1 relation | 17020 | 11051470 | | | | | | | 0 | 13807 | AccessShareLock | t | 75284454 | f | 2 relation | 17020 | 11051470 | | | | | | | 2653175988 | 15572 | AccessExclusiveLock | f | 113747736 | t | 2 relation | 17020 | 11051470 | | | | | | | 0 | 13830 | AccessShareLock | t | 75284454 | f | 3 relation | 17020 | 11051470 | | | | | | | 2653198212 | 15577 | AccessExclusiveLock | f | 113747736 | t | 3 relation | 17020 | 11051470 | | | | | | | 2653197212 | 15583 | ShareLock | t | 113747736 | t | 4 relation | 17020 | 11051470 | | | | | | | 2653197212 | 15583 | AccessExclusiveLock | t | 113747736 | t | 4 relation | 17020 | 11051470 | | | | | | | 0 | 13858 | AccessShareLock | t | 75284454 | f | 5 relation | 17020 | 11051470 | | | | | | | 2653196128 | 15589 | AccessExclusiveLock | f | 113747736 | t | 5 relation | 17020 | 11051470 | | | | | | | 0 | 13091 | AccessShareLock | t | 75284454 | f | 6 relation | 17020 | 11051470 | | | | | | | 2653195038 | 16256 | AccessExclusiveLock | f | 113747736 | t | 6 relation | 17020 | 11051470 | | | | | | | 0 | 13098 | AccessShareLock | t | 75284454 | f | 7 gtlions=# select * from pg_locks where relation='gtlions.cannottruncatetable'::regclass and pid!=14027; locktype | database | relation | page | tuple | transactionid | classid | objid | objsubid | transaction | pid | mode | granted | mppsessionid | mppi swriter | gp_segment_id ----------+----------+----------+------+-------