# Summary

instname | 5831402967448641535
hostname | localhost.localdomain
port | 5432
pg_version | 9.2.2
snap_begin | 2013-01-09 05:00:00
snap_end | 2013-01-09 07:40:00
duration | 02:40:00
total_dbsize | 72 MiB
total_commits | 1203364
total_rollbacks | 9

# Database System

## Database Statistics

database | MiB | +MiB | commit/s | rollback/s | hit% | gets/s | reads/s | rows/s
--- | --- | --- | --- | --- | --- | --- | --- | ---
postgres | 15 | 1 | 0.453 | 0.001 | 99.300 | 91.406 | 0.647 | 493.477
bench | 55 | 31 | 124.896 | 0.000 | 99.800 | 3994.586 | 6.957 | 1609.664

### Transaction Statistics

### Database Size

### Recovery Conflicts

database | conflict tblspc | conflict lock | conflict snapshot | conflict bufferpin | conflict deadlock
--- | --- | --- | --- | --- | ---
postgres | 0 | 0 | 0 | 0 | 0
bench | 0 | 0 | 0 | 0 | 0

## Instance Activity

### WAL Statistics

write_total | write_speed
--- | ---
1084.218 | 0.102

### Instance Processes Ratio

idle (%) | idle in xact (%) | waiting (%) | running (%)
--- | --- | --- | ---
31.08 | 10.52 | 37.05 | 21.35

### Instance Processes

# Operating System

## OS Resource Usage

### CPU Usage

### Load Average

### I/O Usage

device_name | including TableSpaces | total read (MiB) | total write (MiB) | total read time (ms) | total write time (ms) | current I/O queue | total I/O time (ms)
--- | --- | --- | --- | --- | --- | --- | ---
sda2 | {pg_default,pg_global,<pg_xlog_archive>} | 2607 | 25742 | 1130557 | 13853625 | 1.744 | 14977313

### Memory Usage

## Disk Usage

### Disk Usage per Tablespace

tablespace | location | device | used (MiB) | avail (MiB) | remain (%)
--- | --- | --- | --- | --- | ---
<pg_xlog_archive> | /home/postgres/var/pgsql/922/archivedir | 8:2 | 4925 | 12983 | 72.498
pg_default | /home/postgres/var/pgsql/922/data | 8:2 | 4925 | 12983 | 72.498
pg_global | /home/postgres/var/pgsql/922/data | 8:2 | 4925 | 12983 | 72.498

### Disk Usage per Table

database | schema | table | size (MiB) | table reads | index reads | toast reads
--- | --- | --- | --- | --- | --- | ---
bench | public | pgbench_history | 24 | 50766 | 0 | 0
bench | public | pgbench_tellers | 1 | 11331 | 6 | 0
bench | public | pgbench_branches | 0 | 1979 | 1 | 0
postgres | statsrepo | column_20130109 | 3 | 1758 | 115 | 0
bench | public | pgbench_accounts | 18 | 751 | 303 | 0
postgres | statsrepo | function | 0 | 480 | 37 | 0
postgres | statsrepo | table_20130109 | 0 | 322 | 28 | 0
postgres | statsrepo | statement | 0 | 299 | 24 | 0
postgres | statsrepo | index_20130109 | 0 | 251 | 26 | 0
postgres | statsrepo | setting | 0 | 86 | 36 | 0
postgres | statsrepo | replication | 0 | 52 | 0 | 0
postgres | statsrepo | checkpoint | 0 | 19 | 31 | 0
postgres | statsrepo | tablespace | 0 | 33 | 16 | 0
postgres | statsrepo | device | 0 | 25 | 24 | 0
postgres | statsrepo | schema | 0 | 28 | 20 | 0
postgres | statsrepo | cpu | 0 | 18 | 29 | 0
postgres | statsrepo | role | 0 | 17 | 29 | 0
postgres | statsrepo | alert | 0 | 21 | 22 | 0
postgres | statsrepo | autoanalyze | 0 | 32 | 9 | 0
postgres | statsrepo | database | 0 | 19 | 19 | 0
postgres | statsrepo | activity | 0 | 12 | 25 | 0
postgres | statsrepo | autovacuum | 0 | 29 | 5 | 0
postgres | statsrepo | loadavg | 0 | 10 | 24 | 0
postgres | statsrepo | memory | 0 | 10 | 23 | 0
postgres | statsrepo | inherits | 0 | 11 | 17 | 0
postgres | statsrepo | snapshot | 0 | 4 | 18 | 0
postgres | statsrepo | instance | 0 | 1 | 12 | 0
postgres | statsrepo | xlog | 0 | 13 | 0 | 0
postgres | statsrepo | lock | 0 | 9 | 0 | 0
postgres | public | test | 0 | 3 | 0 | 0
postgres | public | tbl | 0 | 1 | 0 | 0
postgres | statsrepo | index | 0 | 0 | 0 | 0
postgres | statsrepo | table | 0 | 0 | 0 | 0
postgres | statsrepo | column | 0 | 0 | 0 | 0
postgres | statsrepo | profile | 0 | 0 | 0 | 0

# SQL

## Notable Tables

### Heavily Updated Tables

database | schema | table | INSERT | UPDATE | DELETE | total | HOT (%)
--- | --- | --- | --- | --- | --- | --- | ---
bench | public | pgbench_history | 1197773 | 0 | 0 | 1197773 | 0.000
bench | public | pgbench_branches | 0 | 1197773 | 0 | 1197773 | 99.900
bench | public | pgbench_accounts | 0 | 1197773 | 0 | 1197773 | 96.700
bench | public | pgbench_tellers | 0 | 1197773 | 0 | 1197773 | 99.900
postgres | public | test | 2 | 0 | 100003 | 100005 | 0.000
postgres | statsrepo | column_20130109 | 14349 | 0 | 0 | 14349 | 0.000
postgres | statsrepo | function | 2204 | 0 | 0 | 2204 | 0.000
postgres | statsrepo | table_20130109 | 1315 | 0 | 0 | 1315 | 0.000
postgres | statsrepo | index_20130109 | 1140 | 0 | 0 | 1140 | 0.000
postgres | statsrepo | statement | 1140 | 0 | 0 | 1140 | 0.000
postgres | statsrepo | setting | 950 | 0 | 0 | 950 | 0.000
postgres | statsrepo | autoanalyze | 450 | 0 | 0 | 450 | 0.000
postgres | statsrepo | schema | 304 | 0 | 0 | 304 | 0.000
postgres | statsrepo | autovacuum | 235 | 0 | 0 | 235 | 0.000
postgres | statsrepo | tablespace | 114 | 0 | 0 | 114 | 0.000
postgres | statsrepo | inherits | 114 | 0 | 0 | 114 | 0.000
postgres | public | tbl | 100 | 4 | 1 | 105 | 100.000
postgres | statsrepo | replication | 76 | 0 | 0 | 76 | 0.000
postgres | statsrepo | database | 76 | 0 | 0 | 76 | 0.000
postgres | statsrepo | snapshot | 38 | 38 | 0 | 76 | 100.000
postgres | statsrepo | cpu | 38 | 0 | 0 | 38 | 0.000
postgres | statsrepo | activity | 38 | 0 | 0 | 38 | 0.000
postgres | statsrepo | role | 38 | 0 | 0 | 38 | 0.000
postgres | statsrepo | device | 38 | 0 | 0 | 38 | 0.000
postgres | statsrepo | loadavg | 38 | 0 | 0 | 38 | 0.000
postgres | statsrepo | memory | 38 | 0 | 0 | 38 | 0.000
postgres | statsrepo | xlog | 38 | 0 | 0 | 38 | 0.000
postgres | statsrepo | checkpoint | 34 | 0 | 0 | 34 | 0.000
postgres | statsrepo | lock | 2 | 0 | 0 | 2 | 0.000
postgres | statsrepo | instance | 0 | 0 | 0 | 0 | 0.000
postgres | statsrepo | column | 0 | 0 | 0 | 0 | 0.000
postgres | statsrepo | index | 0 | 0 | 0 | 0 | 0.000
postgres | statsrepo | alert | 0 | 0 | 0 | 0 | 0.000
postgres | statsrepo | table | 0 | 0 | 0 | 0 | 0.000
postgres | statsrepo | profile | 0 | 0 | 0 | 0 | 0.000

### Heavily Accessed Tables

database | schema | table | seq_scan | seq_tup_read | tup_per_seq | hit (%)
--- | --- | --- | --- | --- | --- | ---
postgres | public | test | 7 | 100005 | 14286.429 | 100.000
postgres | statsrepo | schema | 696 | 155546 | 223.486 | 99.800
postgres | statsrepo | tablespace | 19 | 2088 | 109.895 | 88.600
postgres | public | tbl | 7 | 700 | 100.000 | 99.100
postgres | statsrepo | database | 17664 | 1477557 | 83.648 | 100.000
postgres | statsrepo | replication | 19 | 1392 | 73.263 | 79.800
postgres | statsrepo | autovacuum | 48 | 2662 | 55.458 | 95.900
postgres | statsrepo | snapshot | 32397 | 1365456 | 42.148 | 100.000
postgres | statsrepo | xlog | 38 | 1392 | 36.632 | 88.700
bench | public | pgbench_tellers | 64736 | 524270 | 8.099 | 99.900
postgres | statsrepo | lock | 39 | 72 | 1.846 | 79.100
postgres | statsrepo | instance | 5 | 5 | 1.000 | 99.800
bench | public | pgbench_branches | 1563013 | 934770 | 0.598 | 100.000

### Low Density Tables

database | schema | table | tuples | logical_pages | physical_pages | tratio
--- | --- | --- | --- | --- | --- | ---
bench | public | pgbench_accounts | 100000 | 1640 | 2326 | 70
bench | public | pgbench_history | 495472 | 3156 | 3188 | 98

### Fragmented Tables

database | schema | table | column | correlation
--- | --- | --- | --- | ---
bench | public | pgbench_tellers | tid | -0.536
postgres | statsrepo | setting | name | 0.055
postgres | statsrepo | index_20130109 | idx | 0.057
postgres | statsrepo | column_20130109 | attnum | 0.057
postgres | statsrepo | table_20130109 | tbl | 0.061
postgres | statsrepo | column_20130109 | tbl | 0.064
postgres | statsrepo | schema | nsp | 0.217
postgres | statsrepo | tablespace | name | 0.325
postgres | statsrepo | inherits | inhrelid | 0.358
postgres | statsrepo | statement | dbid | 0.392
bench | public | pgbench_accounts | aid | 0.449
postgres | statsrepo | database | dbid | 0.514
postgres | statsrepo | schema | dbid | 0.545
postgres | statsrepo | table_20130109 | dbid | 0.797
postgres | statsrepo | index_20130109 | dbid | 0.824
postgres | statsrepo | column_20130109 | dbid | 0.915
postgres | statsrepo | statement | snapid | 0.999
postgres | statsrepo | function | snapid | 1.000
postgres | statsrepo | table_20130109 | snapid | 1.000

## Query Activity

### Functions

database | schema | function | calls | total time (ms) | self time (ms) | time/call (ms)
--- | --- | --- | --- | --- | --- | ---
postgres | statsrepo | partition_insert | 16804 | 22376.566 | 22376.566 | 1.332
postgres | statsrepo | alert | 38 | 11015.180 | 11015.180 | 289.873
postgres | statsinfo | devicestats | 39 | 5960.133 | 5351.842 | 152.824
postgres | statsrepo | create_partition | 38 | 4012.844 | 585.611 | 105.601
postgres | statsrepo | get_snap_date | 16804 | 3928.368 | 3928.368 | 0.234
postgres | statsrepo | partition_new | 114 | 3427.233 | 3427.233 | 30.063
postgres | statsrepo | get_xlog_tendency | 38 | 3188.818 | 370.302 | 83.916
postgres | statsrepo | xlog_location_diff | 1348 | 2742.539 | 724.322 | 2.035
postgres | statsrepo | get_xlog_stats | 19 | 2076.782 | 17.566 | 109.304
postgres | statsrepo | convert_hex | 5392 | 2018.217 | 2018.217 | 0.374
postgres | statsrepo | get_low_density_tables | 19 | 1899.721 | 1392.929 | 99.985
postgres | statsrepo | get_summary | 19 | 1836.373 | 1463.367 | 96.651
postgres | statsinfo | activity | 39 | 1831.328 | 1831.328 | 46.957
postgres | statsrepo | get_disk_usage_table | 19 | 1110.493 | 1110.493 | 58.447
postgres | statsrepo | get_xact_tendency_report | 19 | 830.207 | 721.891 | 43.695
postgres | statsrepo | get_dbstats | 19 | 828.177 | 498.435 | 43.588
postgres | statsrepo | tps | 9626 | 723.639 | 723.639 | 0.075
postgres | statsinfo | cpustats | 39 | 627.427 | 627.427 | 16.088
postgres | statsinfo | tablespaces | 78 | 613.295 | 613.295 | 7.863
postgres | statsrepo | get_query_activity_functions | 19 | 604.402 | 587.363 | 31.811
postgres | statsrepo | get_flagmented_tables | 19 | 579.418 | 579.418 | 30.496
postgres | statsrepo | get_query_activity_statements | 19 | 576.294 | 566.476 | 30.331
postgres | statsrepo | get_io_usage_tendency_report | 38 | 553.949 | 276.838 | 14.578
postgres | statsrepo | pg_fillfactor | 52 | 506.792 | 506.792 | 9.746
postgres | statsrepo | get_setting_parameters | 19 | 498.670 | 498.670 | 26.246
postgres | statsrepo | pg_size_pretty | 79 | 462.372 | 462.372 | 5.853
postgres | statsrepo | get_schema_info_indexes | 19 | 461.684 | 456.890 | 24.299
postgres | statsrepo | get_cpu_usage_tendency_report | 19 | 375.551 | 333.515 | 19.766
postgres | statsrepo | get_replication_activity | 19 | 372.128 | 372.128 | 19.586
postgres | statsrepo | get_min_snapid2 | 19 | 354.582 | 354.582 | 18.662
postgres | statsrepo | get_autovacuum_activity | 19 | 341.343 | 341.343 | 17.965
postgres | statsrepo | get_checkpoint_activity | 19 | 303.348 | 303.348 | 15.966
postgres | statsinfo | loadavg | 39 | 288.848 | 288.848 | 7.406
postgres | statsrepo | get_io_usage | 19 | 285.908 | 285.908 | 15.048
postgres | statsrepo | get_disk_usage_tablespace | 19 | 261.941 | 261.941 | 13.786
postgres | statsrepo | get_schema_info_tables | 19 | 255.998 | 255.998 | 13.474
postgres | statsrepo | div | 5843 | 208.578 | 208.578 | 0.036
postgres | statsrepo | get_heavily_accessed_tables | 19 | 208.532 | 165.501 | 10.975
postgres | statsinfo | sample | 1853 | 197.834 | 197.834 | 0.107
postgres | statsrepo | get_heavily_updated_tables | 19 | 193.539 | 169.186 | 10.186
postgres | statsrepo | get_lock_activity | 19 | 177.311 | 177.311 | 9.332
postgres | statsrepo | get_memory_tendency | 19 | 135.669 | 135.669 | 7.140
postgres | statsrepo | get_proc_ratio | 19 | 122.897 | 122.897 | 6.468
postgres | public | pg_stat_statements | 38 | 116.354 | 116.354 | 3.062
postgres | statsrepo | get_loadavg_tendency | 19 | 115.653 | 115.653 | 6.087
postgres | statsrepo | get_proc_tendency_report | 19 | 77.747 | 77.747 | 4.092
postgres | statsrepo | get_recovery_conflicts | 19 | 69.050 | 69.050 | 3.634
postgres | statsrepo | get_long_transactions | 19 | 64.645 | 64.645 | 3.402
postgres | statsrepo | get_dbsize_tendency_report | 19 | 61.097 | 61.097 | 3.216
postgres | statsrepo | get_autovacuum_activity2 | 19 | 48.996 | 48.996 | 2.579
postgres | statsinfo | snapshot | 8 | 36.996 | 36.996 | 4.625
postgres | statsinfo | memory | 39 | 18.865 | 18.865 | 0.484
postgres | statsrepo | get_max_snapid2 | 19 | 12.265 | 12.265 | 0.646
postgres | statsrepo | get_version | 3 | 3.023 | 3.023 | 1.008
postgres | statsinfo | profile | 39 | 1.078 | 1.078 | 0.028
postgres | statsinfo | last_xact_activity | 2 | 0.476 | 0.476 | 0.238
postgres | statsrepo | regist_alert | 0 | 0.000 | 0.000 | 0.000
postgres | statsrepo | get_constraintdef | 0 | 0.000 | 0.000 | 0.000

### Statements

user | database | query | calls | total time (sec) | time/call (ms)
--- | --- | --- | --- | --- | ---
postgres | bench | UPDATE pgbench_branches SET bbalance = bbalance + ? WHERE bid = ?; | 1197604 | 13466.890 | 0.011
postgres | bench | UPDATE pgbench_tellers SET tbalance = tbalance + ? WHERE tid = ?; | 1197607 | 3466.538 | 0.003
postgres | postgres | SELECT c.oid AS relid, c.relnamespace, c.reltablespace, c.relname, c.reltoastrelid, c.reltoastidxid, c.relkind, c.relpages, c.reltuples, c.reloptions, pg_relation_size(c.oid), pg_stat_get_numscans(c.oid) AS seq_scan, pg_stat_get_tuples_returned(c.oid) AS seq_tup_read, sum(pg_stat_get_numscans(i.indexrelid))::bigint AS idx_scan, sum(pg_stat_get_tuples_fetched(i.indexrelid))::bigint + pg_stat_get_tuples_fetched(c.oid) AS idx_tup_fetch, pg_stat_get_tuples_inserted(c.oid) AS n_tup_ins, pg_stat_get_tuples_updated(c.oid) AS n_tup_upd, pg_stat_get_tuples_deleted(c.oid) AS n_tup_del, pg_stat_get_tuples_hot_updated(c.oid) AS n_tup_hot_upd, pg_stat_get_live_tuples(c.oid) AS n_live_tup, pg_stat_get_dead_tuples(c.oid) AS n_dead_tup, pg_stat_get_blocks_fetched(c.oid) - pg_stat_get_blocks_hit(c.oid) AS heap_blks_read, pg_stat_get_blocks_hit(c.oid) AS heap_blks_hit, sum(pg_stat_get_blocks_fetched(i.indexrelid) - pg_stat_get_blocks_hit(i.indexrelid))::bigint AS idx_blks_read, sum(pg_stat_get_bl | 38 | 321.919 | 8.472
postgres | postgres | DELETE FROM test ; | 4 | 247.824 | 61.956
postgres | bench | UPDATE pgbench_accounts SET abalance = abalance + ? WHERE aid = ?; | 1197607 | 243.708 | 0.000
postgres | postgres | UPDATE tbl SET num = ? WHERE num = ? ; | 4 | 132.366 | 33.091
postgres | bench | SELECT abalance FROM pgbench_accounts WHERE aid = ?; | 1197607 | 55.594 | 0.000
postgres | bench | INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (?, ?, ?, ?, CURRENT_TIMESTAMP); | 1197604 | 26.100 | 0.000
postgres | postgres | INSERT INTO statsrepo.column VALUES ($1, $2, $3, $4, statsrepo.get_snap_date($1), $5, $6, $7, $8, $9, $10, $11, $12, $13) | 14349 | 12.124 | 0.001
postgres | postgres | SELECT * FROM statsrepo.alert($1) | 38 | 11.042 | 0.291
postgres | postgres | INSERT INTO statsrepo.table VALUES ($1, $2, $3, $4, statsrepo.get_snap_date($1), $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35) | 1315 | 8.071 | 0.006
postgres | postgres | SELECT * FROM statsinfo.devicestats($1) | 38 | 5.962 | 0.157
postgres | bench | BEGIN; | 1197607 | 5.873 | 0.000
postgres | postgres | INSERT INTO statsrepo.statement SELECT (($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19)::statsrepo.statement).* FROM statsrepo.database d WHERE d.snapid = $1 AND d.dbid = $2 | 1710 | 4.469 | 0.003
postgres | postgres | SELECT statsrepo.create_partition($1) | 38 | 4.102 | 0.108
postgres | postgres | INSERT INTO statsrepo.setting VALUES ($1, $2, $3, $4, $5) | 1425 | 3.865 | 0.003
postgres | postgres | SELECT d.oid AS dbid, d.datname, pg_database_size(d.oid), CASE WHEN pg_is_in_recovery() THEN ? ELSE age(d.datfrozenxid) END, pg_stat_get_db_xact_commit(d.oid) AS xact_commit, pg_stat_get_db_xact_rollback(d.oid) AS xact_rollback, pg_stat_get_db_blocks_fetched(d.oid) - pg_stat_get_db_blocks_hit(d.oid) AS blks_read, pg_stat_get_db_blocks_hit(d.oid) AS blks_hit, pg_stat_get_db_tuples_returned(d.oid) AS tup_returned, pg_stat_get_db_tuples_fetched(d.oid) AS tup_fetched, pg_stat_get_db_tuples_inserted(d.oid) AS tup_inserted, pg_stat_get_db_tuples_updated(d.oid) AS tup_updated, pg_stat_get_db_tuples_deleted(d.oid) AS tup_deleted, pg_stat_get_db_conflict_tablespace(d.oid) AS confl_tablespace, pg_stat_get_db_conflict_lock(d.oid) AS confl_lock, pg_stat_get_db_conflict_snapshot(d.oid) AS confl_snapshot, pg_stat_get_db_conflict_bufferpin(d.oid) AS confl_bufferpin, pg_stat_get_db_conflict_startup_deadlock(d.oid) AS confl_deadlock, pg_stat_get_db_temp_files(d.oid) AS temp_files, pg_stat_get_db_temp_byte | 38 | 3.855 | 0.101
postgres | postgres | SELECT ? FROM pg_proc, pg_namespace n WHERE nspname = ? AND proname = ? AND pronamespace = n.oid LIMIT ? | 57 | 2.616 | 0.046
postgres | postgres | INSERT INTO statsrepo.index VALUES ($1, $2, $3, $4, statsrepo.get_snap_date($1), $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22) | 1140 | 2.575 | 0.002
postgres | bench | END; | 1249164 | 2.462 | 0.000
postgres | postgres | SELECT * FROM statsinfo.activity() | 58 | 2.409 | 0.042
postgres | postgres | INSERT INTO statsrepo.function VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) | 2204 | 2.189 | 0.001
postgres | postgres | SELECT * FROM statsrepo.get_xlog_stats($1, $2) | 19 | 2.077 | 0.109
postgres | postgres | SELECT datname AS "database", nspname AS "schema", relname AS "table", n_live_tup AS tuples, logical_pages, physical_pages, tratio FROM statsrepo.get_low_density_tables($1, $2) ORDER BY tratio | 26 | 1.959 | 0.075
postgres | postgres | SELECT * FROM statsrepo.get_summary($1, $2) | 26 | 1.863 | 0.072
postgres | postgres | INSERT INTO statsrepo.tablespace VALUES ($1, $2, $3, $4, $5, $6, $7, $8) | 171 | 1.679 | 0.010
postgres | postgres | SELECT i.oid AS indexrelid, c.oid AS relid, i.reltablespace, i.relname AS indexrelname, i.relam, i.relpages, i.reltuples, i.reloptions, x.indisunique, x.indisprimary, x.indisclustered, x.indisvalid, x.indkey, pg_get_indexdef(i.oid), pg_relation_size(i.oid), pg_stat_get_numscans(i.oid) AS idx_scan, pg_stat_get_tuples_returned(i.oid) AS idx_tup_read, pg_stat_get_tuples_fetched(i.oid) AS idx_tup_fetch, pg_stat_get_blocks_fetched(i.oid) - pg_stat_get_blocks_hit(i.oid) AS idx_blks_read, pg_stat_get_blocks_hit(i.oid) AS idx_blks_hit FROM pg_class c JOIN pg_index x ON c.oid = x.indrelid JOIN pg_class i ON i.oid = x.indexrelid JOIN pg_namespace n ON n.oid = c.relnamespace WHERE c.relkind IN (?, ?) AND n.nspname <> ALL ((? || $1 || ?)::text[]) | 57 | 1.557 | 0.027
postgres | bench | SELECT c.oid AS relid, c.relnamespace, c.reltablespace, c.relname, c.reltoastrelid, c.reltoastidxid, c.relkind, c.relpages, c.reltuples, c.reloptions, pg_relation_size(c.oid), pg_stat_get_numscans(c.oid) AS seq_scan, pg_stat_get_tuples_returned(c.oid) AS seq_tup_read, sum(pg_stat_get_numscans(i.indexrelid))::bigint AS idx_scan, sum(pg_stat_get_tuples_fetched(i.indexrelid))::bigint + pg_stat_get_tuples_fetched(c.oid) AS idx_tup_fetch, pg_stat_get_tuples_inserted(c.oid) AS n_tup_ins, pg_stat_get_tuples_updated(c.oid) AS n_tup_upd, pg_stat_get_tuples_deleted(c.oid) AS n_tup_del, pg_stat_get_tuples_hot_updated(c.oid) AS n_tup_hot_upd, pg_stat_get_live_tuples(c.oid) AS n_live_tup, pg_stat_get_dead_tuples(c.oid) AS n_dead_tup, pg_stat_get_blocks_fetched(c.oid) - pg_stat_get_blocks_hit(c.oid) AS heap_blks_read, pg_stat_get_blocks_hit(c.oid) AS heap_blks_hit, sum(pg_stat_get_blocks_fetched(i.indexrelid) - pg_stat_get_blocks_hit(i.indexrelid))::bigint AS idx_blks_read, sum(pg_stat_get_bl | 38 | 0.450 | 0.012
postgres | bench | truncate pgbench_history | 2 | 0.015 | 0.007
postgres | bench | alter table pgbench_accounts add primary key (aid) | 0 | 0.000 | 0.000

## Long Transactions

pid | client address | when to start | duration (sec) | query
--- | --- | --- | --- | ---
54134 |  | 2013-01-09 05:51:59 | 420.784 | <IDLE> in transaction
53788 |  | 2013-01-09 05:50:37 | 412.735 | <IDLE> in transaction
49640 |  | 2013-01-09 05:14:51 | 228.923 | DELETE FROM test ;
51051 |  | 2013-01-09 05:25:43 | 217.382 | <IDLE> in transaction
50282 |  | 2013-01-09 05:19:30 | 195.480 | <IDLE> in transaction
49611 |  | 2013-01-09 05:13:45 | 75.045 | <IDLE> in transaction
49078 |  | 2013-01-09 05:09:30 | 29.705 | <IDLE> in transaction
53503 |  | 2013-01-09 05:46:46 | 24.585 | autovacuum: ANALYZE public.pgbench_accounts
53168 |  | 2013-01-09 05:43:47 | 18.027 | autovacuum: ANALYZE public.pgbench_accounts
52722 |  | 2013-01-09 06:24:38 | 4.503 | END;
60590 |  | 2013-01-09 07:35:02 | 3.748 | INSERT INTO statsrepo.function VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)
53092 |  | 2013-01-09 06:30:05 | 3.385 | <IDLE> in transaction
58854 |  | 2013-01-09 06:29:47 | 3.297 | autovacuum: ANALYZE public.pgbench_history
64449 |  | 2013-01-09 07:15:17 | 3.245 | autovacuum: ANALYZE statsrepo.statement
59849 |  | 2013-01-09 06:37:47 | 3.088 | autovacuum: ANALYZE public.pgbench_history
60961 |  | 2013-01-09 06:46:47 | 2.874 | autovacuum: ANALYZE public.pgbench_accounts
62061 |  | 2013-01-09 06:55:48 | 2.503 |
52729 |  | 2013-01-09 06:06:08 | 2.015 | END;
52729 |  | 2013-01-09 06:18:10 | 1.862 | END;
52729 |  | 2013-01-09 05:39:38 | 1.532 | UPDATE pgbench_tellers SET tbalance = tbalance + -2011 WHERE tid = 10;
63046 |  | 2013-01-09 07:03:49 | 1.372 | autovacuum: ANALYZE public.pgbench_history
60558 |  | 2013-01-09 07:21:39 | 1.369 | END;
60557 |  | 2013-01-09 07:26:49 | 1.217 | END;
63537 |  | 2013-01-09 07:07:49 | 1.202 | autovacuum: ANALYZE public.pgbench_history
64024 |  | 2013-01-09 07:11:49 | 1.062 | autovacuum: ANALYZE public.pgbench_history

## Lock Conflicts

database | schema | relation | duration | blockee pid | blocker pid | blocker gid | blockee query | blocker query
--- | --- | --- | --- | --- | --- | --- | --- | ---
postgres |  |  | 00:03:13 | 51095 | 51051 |  | DELETE FROM test ; | SELECT num FROM test FOR UPDATE ;
postgres |  |  | 00:02:06 | 54134 | 53788 |  | UPDATE tbl SET num = 23 WHERE num = 100 ; | UPDATE tbl SET num = 55 WHERE num = 78 ;DELETE FROM tbl WHERE num = 100 ;

# Operation Activity

## Checkpoint Activity

total checkpoints | 35
checkpoints by time | 20
checkpoints by xlog | 15
avg written buffers | 2148.657
max written buffers | 3467.000
avg duration (sec) | 84.575
max duration (sec) | 150.534

## Autovacuum Activity

### Basic Statistics (Average)

database | schema | table | count | avg index scans | avg removed rows | avg remain rows | avg duration (sec) | max duration (sec)
--- | --- | --- | --- | --- | --- | --- | --- | ---
postgres | public | test | 1 | 0.000 | 100002.000 | 0.000 | 1.140 | 1.140
bench | public | pgbench_accounts | 3 | 0.667 | 3993.333 | 118713.333 | 1.213 | 2.180
bench | public | pgbench_tellers | 118 | 0.119 | 342.492 | 1547.627 | 0.008 | 0.180
bench | pg_catalog | pg_statistic | 1 | 1.000 | 90.000 | 400.000 | 2.580 | 2.580
postgres | pg_catalog | pg_statistic | 1 | 1.000 | 65.000 | 592.000 | 0.270 | 0.270
bench | public | pgbench_branches | 111 | 0.928 | 17.378 | 1609.000 | 0.020 | 0.560

### I/O Statistics (Average)

database | schema | table | avg page hit | avg page miss | avg page dirty | avg read rate | avg write rate
--- | --- | --- | --- | --- | --- | --- | ---
bench | public | pgbench_accounts | 6307.667 | 1.000 | 7.333 | 0.007 | 0.061
postgres | public | test | 1338.000 | 2.000 | 185.000 | 0.014 | 1.259
postgres | pg_catalog | pg_statistic | 112.000 | 11.000 | 16.000 | 0.315 | 0.459
bench | pg_catalog | pg_statistic | 83.000 | 19.000 | 22.000 | 0.057 | 0.066
bench | public | pgbench_branches | 76.180 | 1.586 | 1.360 | 0.279 | 8.609
bench | public | pgbench_tellers | 69.000 | 1.229 | 1.051 | 10.270 | 10.056

## Replication Activity

user | postgres | postgres
appname | walreceiver | sby1
client addr | ::1 | ::1
client_host |  |
client_port | 58639 | 58640
backend start | 2013-01-09 03:14:32 | 2013-01-09 03:14:34
state | streaming | streaming
current location | 0/4FBF52B8 (00000001000000000000004F) | 0/4FBF5818 (00000001000000000000004F)
sent location | 0/4FBF52B8 (00000001000000000000004F) | 0/4FBF52B8 (00000001000000000000004F)
write location | 0/4FBF52B8 (00000001000000000000004F) | 0/4FBF52B8 (00000001000000000000004F)
flush location | 0/4FBF50A8 (00000001000000000000004F) | 0/4FBF52B8 (00000001000000000000004F)
replay location | 0/4FBF50A8 (00000001000000000000004F) | 0/4FBF50A8 (00000001000000000000004F)
sync priority | 0 | 1
sync state | async | sync

# Information

## Schema Information

### Table

database | schema | table | columns | row width | MiB | +MiB | table scans | index scans
--- | --- | --- | --- | --- | --- | --- | --- | ---
bench | public | pgbench_accounts | 4 | 97 | 18 | 5 | 0 | 2395546
bench | public | pgbench_branches | 3 | 8 | 0 | 0 | 1563013 | 263005
bench | public | pgbench_history | 6 | 24 | 24 | 22 | 0 | 0
bench | public | pgbench_tellers | 4 | 12 | 1 | 1 | 64736 | 1145346
postgres | public | tbl | 1 | 4 | 0 | 0 | 7 | 0
postgres | public | test | 1 | 4 | 0 | -3 | 7 | 0

### Index

database | schema | index | table | MiB | +MiB | scans | rows/scan | reads | hits | keys
--- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---
bench | public | pgbench_accounts_pkey | pgbench_accounts | 4 | 2 | 2395546 | 1.000 | 303 | 7193513 | aid
bench | public | pgbench_branches_pkey | pgbench_branches | 0 | 0 | 263005 | 1.000 | 1 | 264266 | bid
bench | public | pgbench_tellers_pkey | pgbench_tellers | 0 | 0 | 1145346 | 0.061 | 6 | 2724190 | tid

## Setting Parameters

### Parameter

name | setting | source
--- | --- | ---
TimeZone | US/Pacific | configuration file
archive_command | cp %p /home/postgres/var/pgsql/922/archivedir/%f | configuration file
archive_mode | on | configuration file
default_text_search_config | pg_catalog.english | configuration file
lc_messages | C | configuration file
log_autovacuum_min_duration | 0 | configuration file
log_checkpoints | on | configuration file
log_destination | csvlog | override
log_min_messages | log | configuration file
log_timezone | US/Pacific | configuration file
logging_collector | on | override
max_stack_depth | 2048 | environment variable
max_wal_senders | 3 | configuration file
pg_statsinfo.enable_maintenance | 3 | configuration file
pg_statsinfo.snapshot_interval | 300 | configuration file
pg_statsinfo.syslog_line_prefix | %t %p %c-%l %x %q(%u, %d, %r, %a) | configuration file
pg_statsinfo.syslog_min_messages | error | configuration file
pg_statsinfo.textlog_line_prefix | %t %p %c-%l %x %q(%u, %d, %r, %a) | configuration file
shared_buffers | 4096 | configuration file
shared_preload_libraries | pg_statsinfo, pg_stat_statements | configuration file
synchronous_standby_names | sby1 | configuration file
track_functions | all | configuration file
transaction_isolation | read committed | override
wal_buffers | 128 | override
wal_level | hot_standby | configuration file

#### How to see a Summary table.

- instname : database cluster instance id
- hostname : host server name
- port : port of database cluster instance
- pg_version : version of PostgreSQL
- snap_begin : start point in this report
- snap_end : end point in this report
- duration : term in this report
- total_dbsize : total database size
- total_commits : total commit transactions in this database cluster
- total_rollbacks : total rollback transactions in this database cluster

#### How to see a Database Statistics table.

- database : database name
- MiB : size of database (MiB)
- +MiB : increase size of database (MiB)
- commit/s : committed transactions per second
- rollback/s : rollback transactions per second
- hit% : cache hit's rate (shared_buffers hit's rate)
- gets/s : read blocks from disk and disk cache per second
- reads/s : read blocks from disk per second
- rows/s : number of rows from tables and indexes per second

#### How to see a Transaction Statistics graph.

- x axis : time
- y axis : transactions per second
- [database name] commit_tps : commited transactions of [database name] per second
- [database name] rollback_tps : rollback transaction of [database name] per second

#### How to see a Database Size table.

- x axis : time
- y axis : size of database
- [database name] size : size of [database name]

#### How to see a Recovery Conflicts table.

- database : database name
- conflict tblspc : number of query cancels by conflict with deleted table space
- conflict lock : number of query cancels by conflict with database locks
- conflict snapshot : number of query cancels by conflict with VACUUM in tuples
- conflict bufferpin : number of query cancels by conflict with VACUUM in shared_buffers
- conflict deadlock : number of query cancels by deadlocks

#### How to see a WAL Statistics(total) graph.

- write_total : total size of WAL(xlog) data in this report (MiB)
- write_speed : average size of WAL(xlog) data in this report (MiB)

#### How to seea WAL Statistics graphs.

- x axis : time (snapshot time)
- y axis1 (left) : size of WAL(xlog) data per snapshot (MiB)
- y axis2 (right) : size of WAL(xlog) data per second (MiB/second)
- write_size : size of WAL output / snapshot time (MiB)
- write_size_per_sec : size pf WAL output / second (MiB/second)

#### How to see a Instance Processes Ratio table.

- idle (%) : ratio of idle backend process (%)
- idle in xact (%) : ratio of idle backend process in transaction (%)
- waiting (%) : ratio of waiting backend process by locks (%)
- running (%) : ratio of running backend process in transaction (%)

#### How to see a Instance Processes graph.

- x axis : time
- y axis : ratio (%)
- idle (%) : ratio of idle backend process (%)
- idle in xact (%) : ratio of idle backend process in transaction (%)
- waiting (%) : ratio of waiting backend process by locks (%)
- running (%) : ratio of running backend process in transaction (%)

#### How to see a CPU Usage graph.

- x axis : time
- y axis : ratio(%)
- user (%) : ratio of CPU usage in user mode (%)
- system (%) : ratio of CPU usage in system mode (%)
- iowait (%) : ratio of CPU usage in iowait (%)
- idle (%) : ratio of CPU usage in idle (%)

#### How to see a Load Average graph.

- x axis : time
- y axis : load average
- 1min : load average in one minute
- 5min : load average in five minutes
- 15min : load average in fifteen minutes

#### How to see a I/O Usage table/graph.

- device_name : device name
- Including TableSpaces : size of table space in a device
- total read (MiB) : total read size in a device (MiB)
- total write (MiB) : total write size in a device (MiB)
- total read time (ms) : total read time in a device (ms)
- total write time (ms) : total write time in a device (ms)
- current I/O queue : number of current I/O queue in a device
- total I/O time (ms) : total time of I/O in a device (ms)

#### How to see a I/O Size

- x axis : time
- y axis : database size (KiB/s)
- [device] read(KiB/s) : read I/O size per second in a device (KiB/s)
- [device] write(KiB/s) : write I/O size per second in a device (KiB/s)

#### How to see a I/O Time

- x axis : time
- y axis : avarage time (ms)
- [device] avg read time (ms) : time of read I/O in a device (ms)
- [device] avg write time (ms) : time of write I/O in a device (ms)

#### How to see a memory Uage graph table.

- x axis : time
- y axis : size (MiB)
- memfree : size of free memory (MiB)
- buffers : size of buffers cached (MiB)
- cached : size of file cached(not include buffer cached) (MiB)
- swap : size of swap (MiB)
- dirty : size of dirty pages (MiB)

#### How to see a Disk Usage per Tablespace table.

- tablespace : name of tablespace
- location : directory of tablespace
- device : device number of directory of tablespace
- used (MiB) : usage data size in table space directory device (MiB)
- avail (MiB) : avalable data size in table space directory device (MiB)
- remain (%) : remain data size in table space directory device

#### How to see a Disk Usage per Table table/graph.

- database : database name
- schema : schema name
- table : table name
- size (MiB) : size of table (MiB)
- table reads : table_blocks_reads
- index reads : index_blocks_reads
- toast reads : TOAST_blocks_reads

#### How to see a Table Size table.

- entry : table name [database name].[schema name].[table name])
- value : table size ratio

#### How to see a Disk Read table.

- entry : table name ([database name].[schema name].[table name])
- value : amount of read all blocks (all tables, indexes, TOAST table and TOAST index)

#### How to see a Heavily Updated Tables table.

- database : database name
- schema : schema name
- table : table name
- INSERT : number of INSERT rows
- UPDATE : number of UPDATE rows (include HOT update)
- DELETE :number of DELETE rows
- total : number of INSERT, UPDATE and DELETE rows
- HOT (%) : ratio of HOT update rows per all table rows

#### How to see a Heavily Accessed Tables table.

- database : database name
- schema : schema name
- table : table name
- seq_scan : time of executing sequential scan
- seq_tup_read : rows of sequential scan read
- tup_per_seq : rows of sequential scan read per once
- hit (%) : cache hit ratio

#### How to see a Low Density Tables table.

- database : database name
- schema : schama name
- table : table name
- tuples : tuples in the table
- logical_pages : number of logical pages in all records
- physical_pages : number of physical pages in all records
- tratio : ratio of logical pages per physical pages

#### How to see a Fragmented Tables table.

- database : database name
- schema : schema name
- table : table name
- column : colum name
- correlation : correlation of record sort in table

#### How to see a Functions table.

- Database : database name
- Schema : schema name
- Function : function name
- calls : time of function calls
- total time (ms) : total execute time (ms)
- self time (ms) : self execute time (ms)
- time/call (ms) : total execute time per calls (ms)

#### How to see a Statements table.

- User : user name which executed query
- Database : database name which was executed query
- query : SQL query
- calls : number of executing query
- total time (sec) : total executing time (sec)
- time/call (ms) : average executing time (ms)

#### How to see a Long Transactions table.

- pid : pid of backend process in long transaction
- client address : client ip address of backend process in long transaction
- when to start : start time of long transaction
- duration (sec) : duration time of long transaction (sec)
- query : query of long transaction

#### How to see a Lock Activity table.

- database : database name which has lock waiting object
- schema : schema name which has lock waiting object
- relation : relation name which has lock waiting
- duration : duration time which has lock waiting
- blockee pid : blockee pid which has lock waiting
- blocker pid : blocke pid which has lock
- blocker gid : gid of blocker backend
- blockee query : executing query which is lock wating in transaction
- blocker query : query list which has lock in transaction

#### How to see a Checkpoint Activity table.

- total checkpoints : number of total checkpoint
- checkpoints by time : number of checkpoint executed by checkpoint_timeout
- checkpoints by xlog : number of checkpoint executed by checkpoint segments
- avg written buffers : average written buffer size
- max written buffers : max written buffer size
- avg duration (sec) : average time of checkpoint's duration (sec)
- max duration (sec) : max time of checkpoint's duration (sec)

#### How to see a Basic Statistics. (Average)

- database : database name
- schema : schema name
- table : table name
- count : number of execute autovaccum autovacuum
- avg index scans : number of index scan
- avg removed rows : avarage removed rows
- avg remain rows : average remain rows
- avg duration (sec) : average duration time (sec)
- max duration (sec) : max duration time (sec)

#### How to see a I/O Statistics. (Average)

- database : database name
- schema : schema name
- table : table name
- avg page hit : average page hit
- avg page miss : average page miss
- avg page dirty : average page dirty
- avg read rate : average read rate
- avg write rate : average write rate

#### How to see a Replication Activity table.

- user : user name
- appname : application name
- client addr : IP address in standby
- client_host : host name in standby
- client_port : port number in standby
- backend start : start time of walsender walsender
- state : state of walsender
- current location : current WAL location
- sent location : sent WAL location
- write location : write WAL location in standby (LSN or WAL file name)
- flush location : flush WAL location in standby (LSN or WAL file name)
- replay location : replay WAL location in standby (LSN or WAL file name)
- sync priority : priority of synchronous replication
- sync state : state of synchronous replication

#### How to see a Database table.

This information is not supported in this version. We will support in future version.

#### How to see a Schema table.

This information is not supported in this version. We will support in future version.

#### How to see a Table table.

- database : database name
- schema : schema name
- table : table name
- columns : number of colunms
- row width : average real columns data size (byte)
- MiB : table size (MiB)
- +MiB : increase table size (MiB)
- table scans : number of executing sequential scan
- index scans : number of executing index scan

#### How to see a Index table.

- database : database name
- schema : schema name
- index : index name
- table : table name is refferd to index
- MiB : index size (MiB)
- +MiB : increase index size (MiB)
- scans : number of executing index scans
- rows/scan : returned rows which is executing once index scan
- reads : read by disk blocks
- hits : read by cache blocks
- keys : value of index key

#### How to seea View table.

This information is not supported in this version. We will support in future version.

#### How to see a Sequence table.

This information is not supported in this version. We will support in future version.

#### How to see a Trigger table.

This information is not supported in this version. We will support in future version.

#### How to see a Role table.

This information is not supported in this version. We will support in future version.

#### How to see a Parameter table.

- name : parameter name
- setting : parameter value
- source : setting parameter

#### How to see a Profiles table.

- processing : processing name
- executes : average number of executing