pg_statsinfo: Details

Back to Statistics Top

Summary

name5454638501896836859
hostnamepostgres.linux
port5432
pg_version9.0devel
snapshot begin2010-03-31 12:45:00
snapshot end2010-03-31 12:55:00
snapshot duration00:10:00
total database size9801 kB
total commits571
total rollbacks3

Database Statistics

IDdatabaseMB+MBcommit/srollback/shit%gets/sreads/srows/s
1postgres940.9520.00599.400540.8263.422908.826
2bench35351012.8300.00599.90023343.50423.1099182.790

Transaction Statistics

Database Size

Disk Usage

Disk Usage per Tablespace

IDtablespacelocationdeviceused (MB)avail (MB)remain%
1pg_default/home/postgres/pgdata/head253:0953226416296.517
2pg_global/home/postgres/pgdata/head253:0953226416296.517

Disk Usage per Table

IDdatabaseschematableMBtable readsindex readstoast reads
1benchpublicpgbench_accounts1379168290
2benchpublicpgbench_history14427600
3postgresstatsrepocolumn1591980
4postgresstatsrepoindex0262220
5postgresstatsrepotable0102200
6postgresstatsrepostatement04870
7benchpublicpgbench_tellers04340
8benchpublicpgbench_branches02740
9postgresstatsreposetting0880
10postgresstatsrepofunction0770
Table Size
Disk Reads

Long Transactions

IDpidclient addresswhen to startduration (sec)query

Notable Tables

Heavily Updated Tables

IDdatabaseschematableINSERTUPDATEDELETEtotalHOT%
1benchpublicpgbench_accounts100000607502070750299.100
2benchpublicpgbench_tellers106075010607511100.000
3benchpublicpgbench_branches16075010607502100.000
4benchpublicpgbench_history60749900607499
5postgresstatsrepocolumn101410010141
6postgresstatsrepoindex2014002014
7postgresstatsrepotable1453001453
8postgrespg_catalogpg_statistic114603071753.100
9postgrespg_catalogpg_attribute590223615100.000
10postgrespg_catalogpg_depend494036530
11postgresstatsrepostatement25900259
12postgrespg_catalogpg_class68117118688.900
13postgresstatsreposetting14400144
14benchpg_catalogpg_statistic17112012988.400
15postgresstatsreposchema11900119
16postgrespg_catalogpg_trigger10000100
17postgresstatsrepoautoanalyze680068
18postgrespg_catalogpg_type560258
19benchpg_catalogpg_attribute440044
20postgrespg_toastpg_toast_26192201941
Heavily Updated Tables

Heavily Accessed Tables

IDdatabaseschematableseq_scanseq_tup_readtup_per_seqhit%
1benchpublicpgbench_accounts1100000100000.00099.800
2postgresstatsrepotable1511865791.00099.800
3postgresstatsrepostatement71314187.71495.400
4postgresstatsreposetting7736105.14396.600
5postgresstatsreposchema7326634390.63399.700
6benchpublicpgbench_tellers13850411627008.395100.000
7postgresstatsreposnapshot10393.900100.000
8postgresstatsrepodatabase9323.556100.000
9postgresstatsrepoinstance530.60097.400
10benchpublicpgbench_branches11814856075040.514100.000

Low Density Tables

IDdatabaseschematablerowsdead rowspagesrows per page
1benchpublicpgbench_history29155901536189.817
2benchpublicpgbench_accounts1000017727174457.340

Fragmented Tables

IDdatabaseschematablecolumncorrelation

Checkpoint Activity

total checkpoints12
checkpoints by time0
checkpoints by xlog10
avg written buffers2124.167
max written buffers2739.000
avg duration (sec)11.565
max duration (sec)14.709

Autovacuum Activity

IDdatabaseschematablecountavg index scansavg removed rowsavg remain rowsavg duration (sec)max duration (sec)
1postgrespg_catalogpg_statistic11.00023.000448.0000.0400.040
2benchpublicpgbench_tellers80.750296.37515.2500.0050.020
3benchpublicpgbench_branches80.75073.7507.8750.0020.020

Query Activity

Functions

IDfuncidnamenamefuncnamecallstotal time (ms)self time (ms)time/call (ms)
116660postgresstatsrepodiv872770.008
216396postgrespublicpg_stat_statements9220.222
316385postgresstatsinfosample106110.009
416389postgresstatsinfotablespaces9000.000
516386postgresstatsinfoactivity9000.000

Statements

IDuserdatabasequerycallstotal time (sec)time/call (sec)
1postgresbenchUPDATE pgbench_branches SET bbalance = bbalance + $1 WHERE bid = $2;607630543.5020.001
2postgresbenchUPDATE pgbench_tellers SET tbalance = tbalance + $1 WHERE tid = $2;607631137.3840.000
3postgresbenchUPDATE pgbench_accounts SET abalance = abalance + $1 WHERE aid = $2;60763330.3230.000
4postgresbenchSELECT abalance FROM pgbench_accounts WHERE aid = $1;60763110.1800.000
5postgresbenchINSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES ($1, $2, $3, $4, CURRENT_TIMESTAMP);6076277.0970.000
6postgrespostgresCREATE DATABASE bench; 10.6470.647
7postgresbenchEND;6076270.3670.000
8postgresbenchBEGIN;6076340.3460.000
9postgresbenchcopy pgbench_accounts from stdin10.3340.334
10postgrespostgresSELECT 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 WHERE c.relkind IN ('r', 't')90.1660.018
11postgrespostgresINSERT INTO statsrepo.column VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)101410.1470.000
12postgrespostgres/* * bin/pg_statsrepo.sql * * Copyright (c) 2010, NIPPON TELEGRAPH AND TELEPHONE CORPORATION */ -- Adjust this setting to control where the objects get created. SET search_path = public; BEGIN; SET LOCAL client_min_messages = WARNING; CREATE SCHEMA statsrepo; CREATE TABLE statsrepo.instance ( instid bigserial, name text NOT NULL, hostname text NOT NULL, port integer NOT NULL, pg_version text, PRIMARY KEY (instid), UNIQUE (name, hostname, port) ); CREATE TABLE statsrepo.snapshot ( snapid bigserial, instid bigint, time timestamptz, comment text, PRIMARY KEY (snapid), FOREIGN KEY (instid) REFERENCES statsrepo.instance (instid) ON DELETE CASCADE ); CREATE TABLE statsrepo.tablespace ( snapid bigint, tbs oid, name name, location text, device text, avail bigint, total bigint, spcoptions text[], PRIMARY KEY (snapid, name), FOREIGN KEY (snapid) REFERENCES statsrepo.snapshot (snapid) ON DELETE CASCADE ); CREATE TABLE statsrepo.database ( snapid bigin340.1250.004
13postgrespostgresSELECT d.oid AS dbid, d.datname, pg_database_size(d.oid), age(d.datfrozenxid), 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 FROM pg_database d WHERE datallowconn AND datname <> ALL (('{' || $1 || '}')::text[]) ORDER BY 190.1130.013
14postgresbenchSELECT 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 WHERE c.relkind IN ('r', 't')80.1000.012
15postgrespostgresSELECT 1 FROM ONLY "statsrepo"."snapshot" x WHERE "snapid" OPERATOR(pg_catalog.=) $1 FOR SHARE OF x142200.0920.000
16postgresbenchalter table pgbench_accounts add primary key (aid)10.0850.085
17postgrespostgresSELECT 1 FROM ONLY "statsrepo"."table" x WHERE "snapid" OPERATOR(pg_catalog.=) $1 AND "dbid" OPERATOR(pg_catalog.=) $2 AND "tbl" OPERATOR(pg_catalog.=) $3 FOR SHARE OF x121550.0760.000
18postgrespostgresSELECT 1 FROM ONLY "statsrepo"."database" x WHERE "snapid" OPERATOR(pg_catalog.=) $1 AND "dbid" OPERATOR(pg_catalog.=) $2 FOR SHARE OF x140230.0740.000
19postgresbenchvacuum analyze pgbench_accounts10.0740.074
20postgrespostgresSELECT a.attrelid, a.attnum, a.attname, format_type(atttypid, atttypmod) AS type, a.attstattarget, a.attstorage, a.attnotnull, a.attisdropped, s.stawidth as avg_width, s.stadistinct as n_distinct, CASE WHEN s.stakind1 = 3 THEN s.stanumbers1[1] WHEN s.stakind2 = 3 THEN s.stanumbers2[1] WHEN s.stakind3 = 3 THEN s.stanumbers3[1] WHEN s.stakind4 = 3 THEN s.stanumbers4[1] ELSE NULL::real END AS correlation FROM pg_attribute a LEFT JOIN pg_class c ON a.attrelid = c.oid LEFT JOIN pg_statistic s ON a.attnum = s.staattnum AND a.attrelid = s.starelid AND NOT s.stainherit WHERE a.attnum > 0 AND c.relkind IN ('r', 't')90.0720.008

Setting Parameters

IDnamesettingsource
1default_text_search_configpg_catalog.englishconfiguration file
2lc_messagesCconfiguration file
3log_autovacuum_min_duration0configuration file
4log_checkpointsonconfiguration file
5log_destinationcsvlogoverride
6log_timezoneJapancommand line
7logging_collectoronoverride
8max_stack_depth2048environment variable
9pg_statsinfo.snapshot_interval60configuration file
10pg_statsinfo.textlog_min_messagesdebugconfiguration file
11server_encodingUTF8override
12shared_buffers4096configuration file
13shared_preload_librariespg_statsinfo, pg_stat_statementsconfiguration file
14TimeZoneJapancommand line
15timezone_abbreviationsDefaultcommand line
16track_functionsallconfiguration file

Schema Information

Tables

IDdatabaseschematablecolumnsrow widthMB+MBtable scansindex scans
1benchpublicpgbench_accounts497131311215004
2benchpublicpgbench_branches380011814850
3benchpublicpgbench_history624141400
4benchpublicpgbench_tellers41200138504491232

Indexes

IDdatabaseschemaindextableMB+MBscansrows/scanreadshitskeys
1benchpublicpgbench_accounts_pkeypgbench_accounts2212150041.0008292447153aid
2benchpublicpgbench_branches_pkeypgbench_branches000482bid
3benchpublicpgbench_tellers_pkeypgbench_tellers004912321.0004491441tid

Back to Statistics Top