设为首页 加入收藏

TOP

Aboutstatscollected(五)
2015-11-21 01:59:46 来源: 作者: 【 】 浏览:2
Tags:Aboutstatscollected
_autostats_on_change_threshold. context | user vartype | string source | configuration file min_val | max_val | -[ RECORD 2 ]--------------------------------------------------------------------------------------------------------------------------------- name | gp_autostats_on_change_threshold setting | 80000 unit | category | Developer Options short_desc | Threshold for number of tuples added to table by CTAS or Insert-to to trigger autostats in on_change mode. See gp_autostats_mode. extra_desc | context | user vartype | integer source | configuration file min_val | 0 max_val | 2147483647 gtlions=# \pset x Expanded display is off. gtlions=# drop table test; DROP TABLE gtlions=# create table test ( id int, name varchar(200),age int); NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'id' as the Greenplum Database data distribution key for this table. HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. CREATE TABLE gtlions=# insert into test select generate_series(1,80000),generate_series(1,80000)||'-aaa-bbb',round(random()::numeric,2)*100 limit 20000; INSERT 0 20000 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=# select * from gp_toolkit.gp_stats_missing where smitable='test'; smischema | smitable | smisize | smicols | smirecs -----------+----------+---------+---------+--------- public | test | f | 3 | 0 (1 row) gtlions=# insert into test select generate_series(1,80000),generate_series(1,80000)||'-aaa-bbb',round(random()::numeric,2)*100 limit 20000; INSERT 0 20000 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 20000; INSERT 0 20000 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 count(*) from test; count ------- 60000 (1 row) gtlions=# insert into test select generate_series(1,80000),generate_series(1,80000)||'-aaa-bbb',round(random(
首页 上一页 2 3 4 5 6 7 8 下一页 尾页 5/9/9
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇关系型数据库表结构的两个设计技巧 下一篇MongoDB数据库下载和安装

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: