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 ...
随机推荐
- 1.Spark Streaming另类实验与 Spark Streaming本质解析
1 Spark源码定制选择从Spark Streaming入手 我们从第一课就选择Spark子框架中的SparkStreaming. 那么,我们为什么要选择从SparkStreaming入手开始我们 ...
- 跨域请求方式之Jsonp形式
在浏览器端才有跨域安全限制一说,而在服务器端是没有跨域安全限制的. 在两个异构系统(开发语言不同)之间达到资源共享就需要发起一个跨域请求. 而浏览器的同源策略却限制了从一个源头的文档资源或脚本资源与来 ...
- HDU 4888 Redraw Beautiful Drawings
网络流. $s$向每一个$r[i]$连边,容量为$r[i]$. 每一个$r[i]$向每一个$c[j]$连边,容量为$k$. 每一个$c[j]$向$t$连边容量为$c[j]$. 跑最大流,中间每一条边上 ...
- 【小摘抄】关于C++11下 string各类用法(持续更新)
http://blog.csdn.net/autocyz/article/details/42391155 提供了最简单的详解 下列对本人近期开发中的一些心得体会进行摘抄 1.string按照字符进行 ...
- 原型开发工具 mockplus
韩梦飞沙 韩亚飞 313134555@qq.com yue31313 han_meng_fei_sha 原型开发工具 mockplus 微信(演示) - Mockup Plus Web Ap ...
- CodeForces - 875D High Cry
题面在这里! 直接考虑每个位置成为最右边的最大值的位置,统计不合法区间,补集转化一下就好啦. 复杂度O(N * 30) #include<bits/stdc++.h> #define ll ...
- BZOJ 1260 [CQOI2007]涂色paint(区间DP)
[题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=1260 [题目大意] 假设你有一条长度为n的木版,初始时没有涂过任何颜色 每次你可以把一 ...
- [CODE FESTIVAL 2017]Full Tournament
题意:$2^n$个编号为$1\cdots2^n$的人打比赛,这个比赛会给每个人一个唯一的排名,比赛规则递归地定义如下: $2^n$个人打的是级别为$n$的比赛,初始时他们按某种顺序站成一排 当$n=0 ...
- 【前缀和】【枚举倍数】 Codeforces Round #432 (Div. 2, based on IndiaHacks Final Round 2017) D. Arpa and a list of numbers
题意:给你n个数,一次操作可以选一个数delete,代价为x:或者选一个数+1,代价y.你可以进行这两种操作任意次,让你在最小的代价下,使得所有数的GCD不为1(如果全删光也视作合法). 我们从1到m ...
- 【虚树】hdu6161 Big binary tree
题意:一棵n个结点的完全二叉树,初始i号结点的权值为i.有两种操作:单点修改:询问经过某个结点的路径中,权值和最大的路径的权值和是多少. 修改的时候,暴力修改到根节点的路径上的点的f(x)即可. 跟虚 ...