Aboutstatscollected(四)

2015-11-21 01:59:46 · 作者: · 浏览: 47
-----+----------+-----------+-------------+---------- test | 35866 | 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=# select * from gp_toolkit.gp_stats_missing where smitable='test'; smischema | smitable | smisize | smicols | smirecs -----------+----------+---------+---------+--------- public | test | f | 3 | 0 (1 row) gtlions=# analyze test; ANALYZE 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 | 35866 | 32 | 20000 | 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 ------------+-----------+---------+-----------+-----------+------------+------------------+-------------------+-------------------------------------------------------- --------------------------------------------------------------------------------------+------------- public | test | id | 0 | 4 | -1 | | | {1,801,1601,2401,3201,4001,4801,5601,6401,7201,8001,880 1,9601,10401,11201,12001,12801,13601,14401,15201,16001,16801,17601,18401,19201,20000} | public | test
| name | 0 | 13 | -1 | | | | public | test | age | 0 | 4 | 1 | {32} | {1} | {32} | (3 rows) gtlions=# select * from gp_toolkit.gp_stats_missing where smitable='test'; smischema | smitable | smisize | smicols | smirecs -----------+----------+---------+---------+--------- (0 rows) gtlions=# \q [gpadmin@wx60 ~]$ gpconfig -c gp_autostats_mode -v ON_CHANGE 20141017:16:52:15:009211 gpconfig:wx60:gpadmin-[INFO]:-completed successfully [gpadmin@wx60 ~]$ gpstop -u 20141017:16:52:18:009326 gpstop:wx60:gpadmin-[INFO]:-Starting gpstop with args: -u 20141017:16:52:18:009326 gpstop:wx60:gpadmin-[INFO]:-Gathering information and validating the environment... 20141017:16:52:18:009326 gpstop:wx60:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information 20141017:16:52:18:009326 gpstop:wx60:gpadmin-[INFO]:-Obtaining Segment details from master... 20141017:16:52:18:009326 gpstop:wx60:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 4.2.7.2 build 1' 20141017:16:52:18:009326 gpstop:wx60:gpadmin-[INFO]:-Signalling all postmaster processes to reload . [gpadmin@wx60 ~]$ psql gtlions psql (8.2.15) Type "help" for help. gtlions=# \pset x Expanded display is on. gtlions=# select * from pg_settings where name ~ 'gp_autostats'; -[ RECORD 1 ]--------------------------------------------------------------------------------------------------------------------------------- name | gp_autostats_mode setting | ON_CHANGE unit | category | Developer Options short_desc | Sets the autostats mode. extra_desc | Valid values are NONE, ON_CHANGE, ON_NO_STATS. ON_CHANGE requires setting gp