About stats collected
具体測试例如以下:
[gpadmin@wx60 ~]$ psql gtlions
psql (8.2.15)
Type "help" for help. gtlions=# \timing on
Timing is on.
gtlions=# select version();
version
------------------------------------------------------------------------------------------------------------------------------------------------------
PostgreSQL 8.2.15 (Greenplum Database 4.2.7.2 build 1) on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.4.2 compiled on Feb 25 2014 18:05:04
(1 row) Time: 2.020 ms
gtlions=# \pset x
Expanded display is on.
gtlions=# select * from pg_settings where name ~ 'gp_autostats';
-[ RECORD 1 ]---------------------------------------------------------------------------------------------------------------------------------
name | gp_autostats_mode
setting | ON_NO_STATS
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_autostats_on_change_threshold.
context | user
vartype | string
source | configuration file
min_val |
max_val |
-[ RECORD 2 ]---------------------------------------------------------------------------------------------------------------------------------
name | gp_autostats_on_change_threshold
setting | 2147483647
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 Time: 4.464 ms
gtlions=# \q
[gpadmin@wx60 ~]$ gpconfig -c gp_autostats_on_change_threshold -v 80000
20141017:16:45:27:008114 gpconfig:wx60:gpadmin-[INFO]:-completed successfully
[gpadmin@wx60 ~]$ gpstop -u
20141017:16:45:32:008229 gpstop:wx60:gpadmin-[INFO]:-Starting gpstop with args: -u
20141017:16:45:32:008229 gpstop:wx60:gpadmin-[INFO]:-Gathering information and validating the environment...
20141017:16:45:32:008229 gpstop:wx60:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20141017:16:45:32:008229 gpstop:wx60:gpadmin-[INFO]:-Obtaining Segment details from master...
20141017:16:45:33:008229 gpstop:wx60:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 4.2.7.2 build 1'
20141017:16:45:33:008229 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_NO_STATS
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_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=# drop table if exists 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=# select relname,relfilenode,relpages,reltuples,relhasindex,relnatts from pg_class where relname in ('test') order by relname;
-[ RECORD 1 ]------
relname | test
relfilenode | 35843
relpages | 0
reltuples | 0
relhasindex | f
relnatts | 3 gtlions=# \pset x
Expanded display is off.
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 | 35843 | 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 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 relname,relfilenode,relpages,reltuples,relhasindex,relnatts from pg_class where relname in ('test') order by relname;
relname | relfilenode | relpages | reltuples | relhasindex | relnatts
---------+-------------+----------+-----------+-------------+----------
test | 35843 | 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 | {39} | {1} | {39}
|
(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 NONE
20141017:16:50:17:008707 gpconfig:wx60:gpadmin-[INFO]:-completed successfully
[gpadmin@wx60 ~]$ gpstop -u
20141017:16:50:20:008822 gpstop:wx60:gpadmin-[INFO]:-Starting gpstop with args: -u
20141017:16:50:20:008822 gpstop:wx60:gpadmin-[INFO]:-Gathering information and validating the environment...
20141017:16:50:20:008822 gpstop:wx60:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20141017:16:50:20:008822 gpstop:wx60:gpadmin-[INFO]:-Obtaining Segment details from master...
20141017:16:50:20:008822 gpstop:wx60:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 4.2.7.2 build 1'
20141017:16:50:20:008822 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 | NONE
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_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=# drop table test;
DROP TABLE
gtlions=# \pset x
Expanded display is off.
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 | 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_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()::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 select generate_series(1,80000),generate_series(1,80000)||'-aaa-bbb',round(random()::numeric,2)*100 limit 10000;
INSERT 0 10000
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=# 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 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 select generate_series(1,80000),generate_series(1,80000)||'-aaa-bbb',round(random()::numeric,2)*100 limit 80000;
INSERT 0 80000
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 select generate_series(1,80000),generate_series(1,80000)||'-aaa-bbb',round(random()::numeric,2)*100 limit 80000;
INSERT 0 80000
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 select generate_series(1,90000),generate_series(1,90000)||'-aaa-bbb',round(random()::numeric,2)*100 limit 80001;
INSERT 0 80001
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 | 574 | 361046 | 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 | correla
tion
------------+-----------+---------+-----------+-----------+------------+-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
---+----------------------------------------------------------------------------------------------------------------------------------------------------------+--------
-----
public | test | id | 0 | 4 | -0.174002 | {1241,7638,3257,2327,1485,9298,2465,6481,6316,2423,1618,1694,5551,3915,6216,15550,11567,3513,3
088,18221,1274,7119,1266,5539,5937}
| {0.00020724,0.0001727,0.0001727,0.0001727,0.0001727,0.0001727,0.0001727,0.0001727,0.0001727,0.000
1727,0.0001727,0.00013816,0.00013816,0.00013816,0.00013816,0.00013816,0.00013816,0.00013816,0.00013816,0.00013816,0.00013816,0.00013816,0.00013816,0.00013816,0.0001381
6} | {2,1361,2586,3868,5172,6432,7736,9052,10533,12609,14761,16810,18829,22174,27068,31789,36502,41340,46046,50856,55455,60203,65163,69993,74722,79997,79998} | public | test | name | 0 | 13 | -0.174002 | {1241-aaa-bbb,1485-aaa-bbb,6316-aaa-bbb,9298-aaa-bbb,1618-aaa-bbb,7638-aaa-bbb,2327-aaa-bbb,64
81-aaa-bbb,3257-aaa-bbb,2465-aaa-bbb,2423-aaa-bbb,1266-aaa-bbb,8043-aaa-bbb,4306-aaa-bbb,7255-aaa-bbb,19759-aaa-bbb,6083-aaa-bbb,4287-aaa-bbb,14424-aaa-bbb,4623-aaa-bb
b,8661-aaa-bbb,4980-aaa-bbb,5161-aaa-bbb,8999-aaa-bbb,8694-aaa-bbb} | {0.00020724,0.0001727,0.0001727,0.0001727,0.0001727,0.0001727,0.0001727,0.0001727,0.0001727,0.000
1727,0.0001727,0.00013816,0.00013816,0.00013816,0.00013816,0.00013816,0.00013816,0.00013816,0.00013816,0.00013816,0.00013816,0.00013816,0.00013816,0.00013816,0.0001381
6} | | public | test | age | 0 | 4 | 11 | {19,10,74,32,68,35,75,5,65,93,46} | {0.224026,0.221021,0.217878,0.0573708,0.0556784,0.0546422,0.0538823,0.0300497,0.0290826,0.0285991
,0.0277701}
| {5,10,19,32,35,46,65,68,74,75,93} | (3 rows) gtlions=# truncate tabel test;
ERROR: syntax error at or near "test"
LINE 1: truncate tabel test;
^
gtlions=# truncate table test;
TRUNCATE TABLE
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 | 35936 | 0 | 0 | f | 3
(1 row) gtlions=# insert into test select generate_series(1,90000),generate_series(1,90000)||'-aaa-bbb',round(random()::numeric,2)*100 limit 90000;
INSERT 0 90000
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 | 35936 | 144 | 90576 | f | 3
(1 row) gtlions=# update test set name='a' where id<=79999;
UPDATE 79999
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 | 35936 | 144 | 90576 | f | 3
(1 row) gtlions=# update test set name='a' where id<=79999;
UPDATE 79999
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 | 35936 | 144 | 90576 | f | 3
(1 row) gtlions=# update test set name='a' where id<=80000;
UPDATE 80000
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 | 35936 | 144 | 90576 | f | 3
(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 | 35936 | 144 | 90576 | f | 3
(1 row) gtlions=# update test set name='a' where id<=80001;
UPDATE 80001
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 | 35936 | 574 | 101174 | f | 3
(1 row) gtlions=# truncate table test;
TRUNCATE TABLE
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 | 35995 | 0 | 0 | f | 3
(1 row) gtlions=# insert into test select generate_series(1,90000),generate_series(1,90000)||'-aaa-bbb',round(random()::numeric,2)*100 limit 90000;
INSERT 0 90000
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 | 35995 | 144 | 90576 | f | 3
(1 row) gtlions=# update test set name='a' where id<80000;
UPDATE 79999
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 | 35995 | 144 | 90576 | f | 3
(1 row) gtlions=# update test set name='a' where id<80001;
UPDATE 80000
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 | 35995 | 144 | 90576 | f | 3
(1 row) gtlions=# update test set name='a' where id<80002;
UPDATE 80001
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 | 35995 | 466 | 66052 | f | 3
(1 row)
About stats collected的更多相关文章
- oratop 各个指标项说明
Section 1- oratop and database/instance specifics spid :oratop's server SPID connected to inst ...
- 长见识了,知道了collected和Graphite 这两个东东
今天下午的讨论会议中,听到了两个名词collected和Graphite这是神马东东,以前在bingo的时候也没听说过,开完会下去查了下.原来他两是监控系统的啊.以前也从来没做过系统监控方面的项目,这 ...
- [转] MemCached 的 stats 命令
Memcached有个stats命令,通过它可以查看Memcached服务的许多状态信息.使用方法如下:先在命令行直接输入telnet 主机名端口号,连接到memcached服务器,然后再连接成功后, ...
- [原创博文] 用Python做统计分析 (Scipy.stats的文档)
[转自] 用Python做统计分析 (Scipy.stats的文档) 对scipy.stats的详细介绍: 这个文档说了以下内容,对python如何做统计分析感兴趣的人可以看看,毕竟Python的库也 ...
- Process Stats:了解你的APP如何使用内存(转)
原文地址:http://android-developers.blogspot.com/2014/01/process-stats-understanding-how-your.html?m=1 原作 ...
- Unity 5 Stats窗口
Unity5的 Statistics上的统计信息和Unity4 有一些区别, Statistics窗口,全称叫做 Rendering Statistics Window,即渲染统计窗口(或渲染数据统计 ...
- memcached实战系列(四)memcached stats命令 memcached优化
memcached提供一系列的命令进行优化的查看,方便我们调整我们的存储策略,查看我们的使用率,内存的使用率以及浪费情况.常用的命令有stats.stats settings.stats items. ...
- x264 n-th pass编码时候Stats文件的含义
x264 n-th pass(一般是2pass)编码时所用的文件包括下述x264参数生成.stats文件 options: 1280x816 fps=2997/125 timebase=125/299 ...
- Scipy教程 - 统计函数库scipy.stats
http://blog.csdn.net/pipisorry/article/details/49515215 统计函数Statistical functions(scipy.stats) Pytho ...
随机推荐
- ionic3包还原使用yarn命令执行步骤(解决ionic3懒加载报找不到 module的错误)
使用cnpm 还原ionic3.6的依赖包的时候 可以正常还原,但是使用懒加载就会报找不到 module 的错误.最简单的解决办法是删除node_modules 挂个vpn 重新执行npm insta ...
- Interllij IDEA常用快捷键
[常规] Ctrl+Shift + Enter,语句完成 “!”,否定完成,输入表达式时按 “!”键 Ctrl+E,最近的文件 Ctrl+Shift+E,最近更改的文件 Shift+Click,可以关 ...
- ubuntu16.04安装最新版本的wine
1.安装源 sudo add-apt-repository ppa:wine/wine-builds sudo apt-get update 2.安装wine sudo apt-get install ...
- 按照grouip分组,之后分组调用生成正式凭证 的接口
按照grouip分组,之后分组调用生成正式凭证 的接口 Map<String, List<OperatingLogVO>> resultMap = new HashMap< ...
- oracle中clob字段怎么查询非空列_20180517
select * from uap_groupsynlogvo a where a.log_msg is not null ; 附加demo的建表脚本跟业务数据. 链接:https://pan.bai ...
- Codeforces Round #424 (Div. 2, rated, based on VK Cup Finals) Cards Sorting(树状数组)
Cards Sorting time limit per test 1 second memory limit per test 256 megabytes input standard input ...
- cogs 2039. 树的统计
2039. 树的统计 ★★ 输入文件:counttree.in 输出文件:counttree.out 简单对比时间限制:1 s 内存限制:128 MB [题目描述] 关于树的统计问题有 ...
- [BZOJ2286][SDOI2011]消耗战(虚树DP)
2286: [Sdoi2011]消耗战 Time Limit: 20 Sec Memory Limit: 512 MBSubmit: 4998 Solved: 1867[Submit][Statu ...
- 【回文自动机】bzoj3676 [Apio2014]回文串
回文自动机讲解!http://blog.csdn.net/u013368721/article/details/42100363 pam上每个点代表本质不同的回文子串.len(i)代表长度,cnt(i ...
- 【动态规划】CDOJ1692 这是一道比CCCC简单题更有想象力的中档题
f(i,j)表示打了i行出现j个bug的方案数. 还是跟背包有点像嘛. #include<cstdio> using namespace std; int n,m,b,mod,a[510] ...