Aboutstatscollected(六)

2015-11-21 01:59:46 · 作者: · 浏览: 43
)::numeric,2)*100 limit 19999; INSERT 0 19999 gtlions=# select count(*) from test; count ------- 79999 (1 row) gtlions=# select count(*) from test; count ------- 79999 (1 row) gtlions=# select * from pg_stats where tablename='test'; schemaname | tablename | attname | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation ------------+-----------+---------+-----------+-----------+------------+------------------+-------------------+------------------+------------- (0 rows) gtlions=# insert into test select generate_series(1,80000),generate_series(1,80000)||'-aaa-bbb',round(random()::numeric,2)*100 limit 1; INSERT 0 1 gtlions=# select count(*) from test; count ------- 80000 (1 row) gtlions=# select * from pg_stats where tablename='test'; schemaname | tablename | attname | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation ------------+-----------+---------+-----------+-----------+------------+------------------+-------------------+------------------+------------- (0 rows) gtlions=# insert into test select generate_series(1,80000),generate_series(1,80000)||'-aaa-bbb',round(random()::numeric,2)*100 limit 1; INSERT 0 1 gtlions=# select count(*) from test; count ------- 80001 (1 row) gtlions=# select * from pg_stats where tablename='test'; schemaname | tablename | attname | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation ------------+-----------+---------+-----------+-----------+------------+------------------+-------------------+------------------+------------- (0 rows)
gtlions=# select * from pg_stats where tablename='test'; schemaname | tablename | attname | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation ------------+-----------+---------+-----------+-----------+------------+------------------+-------------------+------------------+------------- (0 rows) gtlions=# select relname,relfilenode,relpages,reltuples,relhasindex,relnatts from pg_class where relname in ('test') order by relname; relname | relfilenode | relpages | reltuples | relhasindex | relnatts ---------+-------------+----------+-----------+-------------+---------- test | 35889 | 0 | 0 | f | 3 (1 row) gtlions=# insert into test select generate_series(1,80000),generate_series(1,80000)||'-aaa-bbb',round(random()::numeric,2)*100 limit 10000; INSERT 0 10000 gtlions=# select count(*) from test; count ------- 90001 (1 row) gtlions=# select relname,relfilenode,relpages,reltuples,relhasindex,relnatts from pg_class where relname in ('test') order by relname; relname | relfilenode | relpages | reltuples | relhasindex | relnatts ---------+-------------+----------+-----------+-------------+---------- test | 35889 | 0 | 0 | f | 3 (1 row) gtlions=# select * from pg_stats where tablename='test'; schemaname | tablename | attname | null_frac | avg_width | n_distinct | most_common_vals | most_common_freqs | histogram_bounds | correlation ------------+-----------+---------+-----------+-----------+------------+------------------+-------------------+------------------+------------- (0 rows) gtlions=# insert into test se