2017-03-16 20 views

回答

2

你可以使用pg_stat_all_tables它,就像這裏:

t=# create table t19 (i int); 
CREATE TABLE 
t=# insert into t19 select 1; 
INSERT 0 1 
t=# select schemaname,relname,n_tup_upd from pg_stat_all_tables order by n_tup_upd desc limit 2; 
schemaname |  relname  | n_tup_upd 
------------+-----------------+----------- 
pg_catalog | pg_operator  |   0 
pg_catalog | pg_auth_members |   0 
(2 rows) 

t=# update t19 set i=2; 
UPDATE 1 
t=# update t19 set i=2; 
UPDATE 1 
t=# select schemaname,relname,n_tup_upd from pg_stat_all_tables order by n_tup_upd desc limit 2; 
schemaname | relname | n_tup_upd 
------------+-------------+----------- 
public  | t19   |   2 
pg_catalog | pg_operator |   0 
(2 rows) 
相關問題