设为首页 加入收藏

TOP

TRUNCATETABLEHANG(一)
2015-07-24 10:27:41 来源: 作者: 【 】 浏览:2
Tags:TRUNCATETABLEHANG
I hava a table gtlions.cannottruncatetable, ZERO rows in this table, i can DELETE from the table, but can not TRUNCATE, hang the statement sql.

Detail info below:
###################On the session 1:
gtlions=# select version();
                                                                       version                                                                        
------------------------------------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 8.2.15 (Greenplum Database 4.2.5.2 build 1) on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.4.2 compiled on May 16 2013 23:35:01
(1 row)

gtlions=# \d+ gtlions.cannottruncatetable
                     Table "gtlions.cannottruncatetable"
      Column      |          Type          | Modifiers | Storage  | Description
------------------+------------------------+-----------+----------+-------------
 host_ip          | character varying      |           | extended |
 sys_int_id       | numeric                |           | main     |
 hostname         | character varying      |           | extended |
 prog_name        | character varying(300) |           | extended |
 app_name         | character varying      |           | extended |
 app_name_en      | character varying      |           | extended |
 app_id           | numeric(12,0)          |           | main     |
 serverport       | numeric(22,0)          |           | main     |
 logpath          | numeric(22,0)          |           | main     |
 log_generall     | numeric(22,0)          |           | main     |
 log_detail       | numeric(22,0)          |           | main     |
 transaction_open | numeric(22,0)          |           | main     |
 generall_open    | numeric(22,0)          |           | main     |
 is_use           | numeric(22,0)          |           | main     |
 id               | numeric(22,0)          |           | main     |
 logmasterswitch  | numeric(22,0)          |           | main     |
 process_numb     | numeric(22,0)          |           | main     |
 process_total    | numeric(22,0)          |           | main     |
 ips_addr         | character varying      |           | extended |
 host_id          | numeric(8,0)           |           | main     |
 prog_id          | numeric(8,0)           |           | main     |
 prog_apptypeid   | numeric(8,0)           |           | main     |
Has OIDs: no
Distributed by: (app_id)

gtlions=# select count(*) from gtlions.cannottruncatetable;
 count
-------
     0
(1 row)
 
gtlions=# select * from pg_class where relname='cannottruncatetable';
        relname         | relnamespace | reltype  | relowner | relam | relfilenode | reltablespace | relpages | reltuples | reltoastrelid | reltoastidxid | relaosegrel
id | relaosegidxid | relhasindex | relisshared | relkind | relstorage | relnatts | relchecks | reltriggers | relukeys | relfkeys | relrefs | relhasoids | relhaspkey |
relhasrules | relhassubclass | relfrozenxid | relacl | reloptions
------------------------+--------------+----------+----------+-------+-------------+---------------+----------+-----------+---------------+---------------+------------
---+---------------+-------------+-------------+---------+------------+----------+-----------+-------------+----------+----------+---------+------------+------------+-
------------+----------------+--------------+--------+------------
 cannottruncatetable |        17021 | 11051471 |    17010 |     0 |    23496358 |             0 |       19 |         0 |      11052150 |             0 |            
 0 |             0 | f           | f           | r       | h          |       22 |         0 |           0 |        0 |        0 |       0 | f          | f          |
f           | f              |   1558748414 |        |
(1 row)
 
gtlions=# select pg_size_pretty(pg_relation_size('gtlions.cannottruncatetable'));
 pg_size_pretty
----------------
 608 kB
(1 row)
 
gtlions=# vacuum analyze gtlions.cannottruncatetable;
VACUUM
gtlions=# select * from pg_class where relname='cannottruncatetable';
        relname         | relnamespace | reltype  | relowner | relam | relfilenode | reltablespace | relpages | reltuples | reltoastrelid | reltoastidxid | relaosegrel
id | relaosegidxid | relhasindex | relisshared | relkind | relstorage | relnatts | relchecks | reltriggers | relu
首页 上一页 1 2 3 4 5 6 下一页 尾页 1/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)