Overview

pgmetrics is an open-source tool to collect and report various statistics and information from a running PostgreSQL server to aid in troubleshooting, monitoring and automation.

  • Server: version, system identifier, timeline, transaction id wraparound, checkpoint lag
  • Replication: primary-side, standby-side, physical and logical replication slots
  • WAL Archiving: archive rate, wal and ready file counts, last success and fail time
  • BG Writer: checkpoint rate, total checkpoints (sched+req), buffers
  • Vacuum-related: ongoing auto/manual vacuum progress, last analyze/vacuum, settings
  • Tablespaces: location, size, disk and inode usage of filesystem
  • Database: size, bloat, disabled triggers, installed extensions, temp files, transaction id wraparound, deadlocks, conflicts
  • Roles: users, groups, membership
  • Active backends: transaction running too long, idling in transaction, waiting for locks
  • Tables: vacuum, analyze, row estimates, idx and seq scans, cache hit ratio, HOT update ratio, size, bloat
  • Indexes: cache hit ratio, scans, rows read/scan, rows fetched/scan
  • Sequences: cache hit ratio
  • System metrics: cores, load average, memory and disk usage
  • Settings: current values, and default ones where different
  • Slow Queries: from pg_stat_statements, if available

pgmetrics is a standalone, dependency-free tool: there are no PostgreSQL extensions to be installed, and no package/installation dependencies for the tool itself.

Output

pgmetrics can report the collected statistics in human-readable text format, or save it into a JSON format file. The JSON format output is intended to be used in scripts for monitoring and automation. pgmetrics can also redisplay the contents of a previously saved JSON file in the text format.

PostgreSQL versions

pgmetrics can work with PostgreSQL versions 9.3 to 10.4. It also works with:

  • Amazon AWS Aurora
  • Amazon AWS RDS
  • Google GCP SQL
  • Postgres 11 (devel)
Availability

pgmetrics is written in Go, and available for download as a zero-dependency statically linked command-line tool for many platforms.

Example

Here is an example of the text output that pgmetrics generates:

$ pgmetrics -h 127.0.0.1 bench test

pgmetrics run at: 9 Apr 2018 1:50:54 AM (now)

PostgreSQL Cluster:
    Name:                develpg10
    Server Version:      10.3
    Server Started:      9 Apr 2018 1:20:12 AM (30 minutes ago)
    System Identifier:   6540060726486386353
    Timeline:            1
    Last Checkpoint:     9 Apr 2018 1:50:38 AM (16 seconds ago)
    Prior LSN:           0/B6D1BC38
    REDO LSN:            0/B89A0210 (28 MiB since Prior)
    Checkpoint LSN:      0/B90AE020 (7.1 MiB since REDO)
    Transaction IDs:     548 to 435488 (diff = 434940)
    Last Transaction:    9 Apr 2018 1:50:54 AM (now)
    Notification Queue:  0.0% used
    Active Backends:     7 (max 100)
    Recovery Mode?       no

System Information:
    Hostname:            deb9
    CPU Cores:           2 x Intel(R) Core(TM) i5-3450 CPU @ 3.10GHz
    Load Average:        2.57
    Memory:              used=1.2 GiB, free=75 MiB, buff=9.9 MiB, cache=696 MiB
    Swap:                used=7.9 MiB, free=2.0 GiB
    +---------------------------------+------------------+
    |                         Setting |            Value |
    +---------------------------------+------------------+
    |                  shared_buffers |  32768 (256 MiB) |
    |                        work_mem |   8192 (8.0 MiB) |
    |            maintenance_work_mem | 131072 (128 MiB) |
    |                    temp_buffers |   1024 (8.0 MiB) |
    |             autovacuum_work_mem |               -1 |
    |                 temp_file_limit |               -1 |
    |            max_worker_processes |                8 |
    |          autovacuum_max_workers |                3 |
    | max_parallel_workers_per_gather |                2 |
    |        effective_io_concurrency |                1 |
    +---------------------------------+------------------+

Outgoing Replication Stats:
    Destination #1:
      User:              mdevan
      Application:       pg_receivewal
      Client Address:    
      State:             streaming
      Started At:        9 Apr 2018 1:42:43 AM (8 minutes ago)
      Sent LSN:          0/BA7B2000
      Written Until:     0/B9600000 (write lag = 18 MiB)
      Flushed Until:     0/B9000000 (flush lag = 6.0 MiB)
      Replayed Until:    
      Sync Priority:     0
      Sync State:        async
    Destination #2:
      User:              mdevan
      Application:       pg_recvlogical
      Client Address:    
      State:             streaming
      Started At:        9 Apr 2018 1:43:33 AM (7 minutes ago)
      Sent LSN:          0/BA7B1A18
      Written Until:     0/B92F6D28 (write lag = 21 MiB)
      Flushed Until:     0/B92F6D28 (no flush lag)
      Replayed Until:    
      Sync Priority:     0
      Sync State:        async

Physical Replication Slots:
    +-------------+--------+---------------+-------------+-----------+
    |        Name | Active | Oldest Txn ID | Restart LSN | Temporary |
    +-------------+--------+---------------+-------------+-----------+
    | walarchslot |    yes |               |  0/B9000000 |        no |
    +-------------+--------+---------------+-------------+-----------+

Logical Replication Slots:
    +----------+---------------+----------+--------+---------------+-------------+---------------+-----------+
    |     Name |        Plugin | Database | Active | Oldest Txn ID | Restart LSN | Flushed Until | Temporary |
    +----------+---------------+----------+--------+---------------+-------------+---------------+-----------+
    | logslot1 | test_decoding |    bench |    yes |               |  0/9987AB18 |    0/B92F6D28 |        no |
    +----------+---------------+----------+--------+---------------+-------------+---------------+-----------+

WAL Files:
    WAL Archiving?       yes
    WAL Files:           35
    Ready Files:         24
    Archive Rate:        0.41 per min
    Last Archived:       9 Apr 2018 1:50:15 AM (39 seconds ago)
    Last Failure:        9 Apr 2018 1:48:15 AM (2 minutes ago)
    Totals:              16 succeeded, 31 failed
    Totals Since:        9 Apr 2018 1:12:10 AM (38 minutes ago)
    +--------------------+---------------+
    |            Setting |         Value |
    +--------------------+---------------+
    |          wal_level |       logical |
    |    archive_timeout |           120 |
    |    wal_compression |            on |
    |       max_wal_size | 1024 (16 GiB) |
    |       min_wal_size | 100 (1.6 GiB) |
    | checkpoint_timeout |            30 |
    |   full_page_writes |            on |
    |  wal_keep_segments |             2 |
    +--------------------+---------------+

BG Writer:
    Checkpoint Rate:     1.91 per min
    Average Write:       18 MiB per checkpoint
    Total Checkpoints:   71 sched (95.9%) + 3 req (4.1%) = 74
    Total Write:         1.8 GiB, @ 805 KiB per sec
    Buffers Allocated:   242201 (1.8 GiB)
    Buffers Written:     169515 chkpt (72.5%) + 31137 bgw (13.3%) + 33312 be (14.2%)
    Clean Scan Stops:    221
    BE fsyncs:           0
    Counts Since:        9 Apr 2018 1:12:10 AM (38 minutes ago)
    +------------------------------+--------------+
    |                      Setting |        Value |
    +------------------------------+--------------+
    |               bgwriter_delay |     200 msec |
    |         bgwriter_flush_after | 64 (512 KiB) |
    |        bgwriter_lru_maxpages |          100 |
    |      bgwriter_lru_multiplier |            2 |
    |                   block_size |         8192 |
    |           checkpoint_timeout |       30 sec |
    | checkpoint_completion_target |          0.5 |
    +------------------------------+--------------+

Backends:
    Total Backends:      7 (7.0% of max 100)
    Problematic:         1 waiting on locks, 5 waiting on other, 2 xact too long, 1 idle in xact
    Waiting for Locks:
      +------+--------+------+-------------+----------+-----------------+-----------------------+
      |  PID |   User |  App | Client Addr | Database |            Wait |           Query Start |
      +------+--------+------+-------------+----------+-----------------+-----------------------+
      | 1929 | mdevan | psql |             |     test | Lock / relation | 9 Apr 2018 1:33:39 AM |
      +------+--------+------+-------------+----------+-----------------+-----------------------+

    Other Waiting Backends:
      +------+--------+---------+-------------+----------+---------------------+-----------------------+
      |  PID |   User |     App | Client Addr | Database |                Wait |           Query Start |
      +------+--------+---------+-------------+----------+---------------------+-----------------------+
      | 1887 | mdevan |    psql |             |     test | Client / ClientRead | 9 Apr 2018 1:33:10 AM |
      | 1927 | mdevan |    psql |             |     test | Client / ClientRead | 9 Apr 2018 1:33:33 AM |
      | 2128 | mdevan |    psql |             |     test | Client / ClientRead | 9 Apr 2018 1:48:43 AM |
      | 2187 | mdevan |    psql |             |     test | Client / ClientRead | 9 Apr 2018 1:50:53 AM |
      | 2191 | mdevan | pgbench |             |    bench |   IO / DataFileRead | 9 Apr 2018 1:50:54 AM |
      +------+--------+---------+-------------+----------+---------------------+-----------------------+

    Long Running (>60 sec) Transactions:
      +------+--------+------+-------------+----------+----------------------------------------+
      |  PID |   User |  App | Client Addr | Database |                      Transaction Start |
      +------+--------+------+-------------+----------+----------------------------------------+
      | 1927 | mdevan | psql |             |     test | 9 Apr 2018 1:33:30 AM (17 minutes ago) |
      | 1929 | mdevan | psql |             |     test | 9 Apr 2018 1:33:37 AM (17 minutes ago) |
      +------+--------+------+-------------+----------+----------------------------------------+

    Idling in Transaction:
      +------+--------+------+-------------+----------+----------+-----------------------+
      |  PID |   User |  App | Client Addr | Database | Aborted? |          State Change |
      +------+--------+------+-------------+----------+----------+-----------------------+
      | 1927 | mdevan | psql |             |     test |       no | 9 Apr 2018 1:33:33 AM |
      +------+--------+------+-------------+----------+----------+-----------------------+

Vacuum Progress:
    No manual or auto vacuum jobs in progress.
    +------------------------------+------------------+
    |                      Setting |            Value |
    +------------------------------+------------------+
    |         maintenance_work_mem | 131072 (128 MiB) |
    |                   autovacuum |               on |
    | autovacuum_analyze_threshold |               50 |
    |  autovacuum_vacuum_threshold |               50 |
    |    autovacuum_freeze_max_age |        200000000 |
    |       autovacuum_max_workers |                3 |
    |           autovacuum_naptime |           60 sec |
    |        vacuum_freeze_min_age |         50000000 |
    |      vacuum_freeze_table_age |        150000000 |
    +------------------------------+------------------+

Roles:
    +----------------------+-------+------+-------+-----------+----------+------------+---------+---------+--------------------------------------------------------------+
    |                 Name | Login | Repl | Super | Creat Rol | Creat DB | Bypass RLS | Inherit | Expires |                                                    Member Of |
    +----------------------+-------+------+-------+-----------+----------+------------+---------+---------+--------------------------------------------------------------+
    |               mdevan |   yes |  yes |   yes |       yes |      yes |        yes |     yes |         |                                                              |
    |           pg_monitor |       |      |       |           |          |            |     yes |         | pg_read_all_settings, pg_read_all_stats, pg_stat_scan_tables |
    | pg_read_all_settings |       |      |       |           |          |            |     yes |         |                                                              |
    |    pg_read_all_stats |       |      |       |           |          |            |     yes |         |                                                              |
    |  pg_stat_scan_tables |       |      |       |           |          |            |     yes |         |                                                              |
    |    pg_signal_backend |       |      |       |           |          |            |     yes |         |                                                              |
    |                staff |   yes |      |       |           |      yes |            |     yes |         |                                                              |
    |                alice |   yes |      |   yes |           |      yes |            |     yes |         |                                                        staff |
    |                  bob |   yes |      |       |       yes |          |            |     yes |         |                                                              |
    |              charlie |       |      |       |           |          |            |     yes |         |                                                        staff |
    |                frank |   yes |      |       |           |          |            |     yes |         |                                                              |
    +----------------------+-------+------+-------+-----------+----------+------------+---------+---------+--------------------------------------------------------------+

Tablespaces:
    +------------+--------+------------------------+---------+----------------------------+-------------------------+
    |       Name |  Owner |               Location |    Size |                  Disk Used |              Inode Used |
    +------------+--------+------------------------+---------+----------------------------+-------------------------+
    | pg_default | mdevan | $PGDATA = /opt/db/main |  44 MiB |  6.8 GiB (38.8%) of 18 GiB | 80765 (6.8%) of 1179648 |
    |  pg_global | mdevan | $PGDATA = /opt/db/main | 573 KiB |  6.8 GiB (38.8%) of 18 GiB | 80765 (6.8%) of 1179648 |
    |    datazfs | mdevan |       /data/pg-main-ts | 1.5 GiB | 4.5 GiB (58.7%) of 7.7 GiB |   945 (0.0%) of 6663752 |
    +------------+--------+------------------------+---------+----------------------------+-------------------------+

Database #1:
    Name:                postgres
    Owner:               mdevan
    Tablespace:          pg_default
    Connections:         0 (no max limit)
    Frozen Xid Age:      443977
    Transactions:        74 (100.0%) commits, 0 (0.0%) rollbacks
    Cache Hits:          94.7%
    Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%
    Total Temp:          0 B in 0 files
    Problems:            0 deadlocks, 0 conflicts
    Totals Since:        9 Apr 2018 1:12:36 AM (38 minutes ago)
    Size:                7.2 MiB

Database #2:
    Name:                bench
    Owner:               mdevan
    Tablespace:          datazfs
    Connections:         3 (no max limit)
    Frozen Xid Age:      443977
    Transactions:        163965 (100.0%) commits, 3 (0.0%) rollbacks
    Cache Hits:          99.0%
    Rows Changed:        ins 25.0%, upd 75.0%, del 0.0%
    Total Temp:          0 B in 0 files
    Problems:            0 deadlocks, 0 conflicts
    Totals Since:        9 Apr 2018 1:12:49 AM (38 minutes ago)
    Size:                1.5 GiB
    Tracked Functions:
      +--------------------+-------+-------------+----------------------+
      |           Function | Calls | Time (self) | Time (self+children) |
      +--------------------+-------+-------------+----------------------+
      |  shobj_description |     5 |     5.691ms |              5.691ms |
      |          substring |  5700 |    56.682ms |             56.682ms |
      | pg_stat_statements |     8 |     3.097ms |              3.097ms |
      +--------------------+-------+-------------+----------------------+

    Installed Extensions:
      +--------------------+---------+-----------------------------------------------------------+
      |               Name | Version |                                                   Comment |
      +--------------------+---------+-----------------------------------------------------------+
      | pg_stat_statements |     1.5 | track execution statistics of all SQL statements executed |
      |            plpgsql |     1.0 |                              PL/pgSQL procedural language |
      +--------------------+---------+-----------------------------------------------------------+

    Slow Queries:
      +--------+----------+------------+-----------+----------------------------------------------------+
      |  Calls | Avg Time | Total Time | Rows/Call |                                              Query |
      +--------+----------+------------+-----------+----------------------------------------------------+
      | 163743 |       0s |    2m6.57s |         1 | UPDATE pgbench_accounts SET abalance = abalance +  |
      | 163742 |       0s |    12.526s |         1 | UPDATE pgbench_branches SET bbalance = bbalance +  |
      |      1 |    8.87s |      8.87s |         0 |                                    analyze verbose |
      | 163743 |       0s |      4.91s |         1 | UPDATE pgbench_tellers SET tbalance = tbalance + $ |
      | 163743 |       0s |     1.815s |         1 | SELECT abalance FROM pgbench_accounts WHERE aid =  |
      | 163742 |       0s |     1.118s |         1 | INSERT INTO pgbench_history (tid, bid, aid, delta, |
      |      3 |     92ms |      278ms |         0 |                            vacuum pgbench_branches |
      |     10 |     24ms |      247ms |        12 | SELECT   current_database() AS db, schemaname, tab |
      | 163742 |       0s |      152ms |         0 |                                                END |
      | 163743 |       0s |      150ms |         0 |                                              BEGIN |
      |     11 |     10ms |      114ms |         1 | SELECT archived_count,     COALESCE(last_archived_ |
      |     33 |      1ms |       34ms |         1 |                      SELECT pg_tablespace_size($1) |
      |      3 |     11ms |       33ms |         0 |                             vacuum pgbench_tellers |
      |     11 |      2ms |       27ms |       273 | SELECT name, setting, COALESCE(boot_val,$1), sourc |
      |     33 |       0s |       27ms |         1 |                        SELECT pg_database_size($1) |
      |     11 |      1ms |       20ms |         2 | SELECT funcid, schemaname, funcname, current_datab |
      |      1 |     18ms |       18ms |         5 | SELECT d.datname as "Name",        pg_catalog.pg_g |
      |     11 |      1ms |       13ms |         2 | SELECT name, current_database(), COALESCE(default_ |
      |      3 |      3ms |        9ms |         1 |              select count(*) from pgbench_branches |
      |      7 |      1ms |        9ms |        65 | SELECT userid, dbid, queryid, LEFT(query, $1), cal |
      |     11 |       0s |        7ms |         4 | SELECT S.relid, S.schemaname, S.relname, current_d |
      |      3 |      1ms |        5ms |         0 |                           truncate pgbench_history |
      |     22 |       0s |        3ms |         1 | SELECT COUNT(*) FROM pg_ls_dir($1) WHERE pg_ls_dir |
      |     11 |       0s |        2ms |         3 | SELECT S.relid, S.indexrelid, S.schemaname, S.reln |
      |     11 |       0s |        2ms |         1 | SELECT usename, application_name,    COALESCE(clie |
      |     44 |       0s |        2ms |         1 |                           SELECT pg_table_size($1) |
      |     11 |       0s |        2ms |         3 | SELECT D.oid, D.datname, D.datdba, D.dattablespace |
      |     11 |       0s |        1ms |        11 | SELECT R.oid, R.rolname, R.rolsuper, R.rolinherit, |
      |     33 |       0s |        1ms |         1 |                  SELECT pg_total_relation_size($1) |
      |      8 |       0s |        1ms |         5 | SELECT COALESCE(datname, $2), COALESCE(usename, $3 |
      |      1 |      1ms |        1ms |         5 | SELECT n.nspname as "Schema",   c.relname as "Name |
      |     11 |       0s |        1ms |         1 | SELECT checkpoints_timed, checkpoints_req, checkpo |
      |     11 |       0s |         0s |         1 | SELECT EXTRACT($1 FROM pg_postmaster_start_time()) |
      |     11 |       0s |         0s |         0 | SELECT relid, schemaname, relname, current_databas |
      |     11 |       0s |         0s |         2 | SELECT slot_name, COALESCE(plugin, $1), slot_type, |
      |     11 |       0s |         0s |         3 | SELECT oid, spcname, pg_get_userbyid(spcowner),    |
      |      3 |       0s |         0s |         5 | SELECT COALESCE(datname, $1), COALESCE(usename, $2 |
      |     11 |       0s |         0s |         1 | SELECT checkpoint_lsn, prior_lsn, redo_lsn, timeli |
      |     11 |       0s |         0s |         1 |  SELECT system_identifier FROM pg_control_system() |
      |     11 |       0s |         0s |         0 | SELECT datname, relid, phase, heap_blks_total, hea |
      |      1 |       0s |         0s |         0 | SELECT pg_catalog.quote_ident(c.relname) FROM pg_c |
      |     11 |       0s |         0s |         1 | SELECT xid, COALESCE(EXTRACT($1 FROM timestamp)::b |
      |     11 |       0s |         0s |         1 | SELECT pg_is_in_recovery(),    COALESCE(pg_last_wa |
      |     11 |       0s |         0s |         0 | SELECT status, receive_start_lsn, receive_start_tl |
      |     11 |       0s |         0s |         0 | SELECT T.oid, T.tgrelid, T.tgname, P.proname     F |
      |      1 |       0s |         0s |         0 |                   select * from pg_stat_statements |
      |     11 |       0s |         0s |         1 | SELECT pg_current_wal_flush_lsn(),     pg_current_ |
      |     11 |       0s |         0s |         1 | SELECT COALESCE(inet_client_addr() = inet_server_a |
      |      8 |       0s |         0s |         1 |               SELECT pg_notification_queue_usage() |
      |     11 |       0s |         0s |         1 |                          SELECT current_database() |
      |      1 |       0s |         0s |         3 |                        select * from pg_tablespace |
      |      1 |       0s |         0s |         1 |           SELECT pg_catalog.set_config($1, $2, $3) |
      +--------+----------+------------+-----------+----------------------------------------------------+

Database #3:
    Name:                test
    Owner:               mdevan
    Tablespace:          pg_default
    Connections:         5 (no max limit)
    Frozen Xid Age:      443977
    Transactions:        377 (94.2%) commits, 23 (5.8%) rollbacks
    Cache Hits:          99.0%
    Rows Changed:        ins 81.7%, upd 0.0%, del 18.3%
    Total Temp:          0 B in 0 files
    Problems:            0 deadlocks, 0 conflicts
    Totals Since:        9 Apr 2018 1:12:54 AM (38 minutes ago)
    Size:                23 MiB
    Sequences:
      +---------------+------------+
      |      Sequence | Cache Hits |
      +---------------+------------+
      | seqtest_a_seq |            |
      +---------------+------------+

    Tracked Functions:
      +-----------------+-------+-------------+----------------------+
      |        Function | Calls | Time (self) | Time (self+children) |
      +-----------------+-------+-------------+----------------------+
      | obj_description |     1 |       383µs |                383µs |
      | col_description |     2 |     1.875ms |              1.875ms |
      |       substring |  6147 |    69.366ms |             69.366ms |
      +-----------------+-------+-------------+----------------------+

    Installed Extensions:
      +---------+---------+------------------------------+
      |    Name | Version |                      Comment |
      +---------+---------+------------------------------+
      | plpgsql |     1.0 | PL/pgSQL procedural language |
      +---------+---------+------------------------------+

    Disabled Triggers:
      +------+---------------+-----------+
      | Name |         Table | Procedure |
      +------+---------------+-----------+
      |  tr1 | public.trtest |    trigfn |
      +------+---------------+-----------+

    Slow Queries:
      +-------+----------+------------+-----------+----------------------------------------------------+
      | Calls | Avg Time | Total Time | Rows/Call |                                              Query |
      +-------+----------+------------+-----------+----------------------------------------------------+
      |     2 |   3.333s |     6.666s |         0 |                                         checkpoint |
      |     2 |    424ms |      848ms |         0 |                             vacuum verbose vactest |
      |     2 |    195ms |      390ms |     55000 | with g as (select generate_series($1, $2) as v)    |
      |     1 |    310ms |      310ms |    100000 | insert into vactest select a from generate_series( |
      |    10 |     21ms |      212ms |         9 | SELECT   current_database() AS db, schemaname, tab |
      |     1 |    158ms |      158ms |         0 |                            analyze verbose vactest |
      |    10 |     12ms |      129ms |         5 | SELECT S.relid, S.schemaname, S.relname, current_d |
      |     3 |     39ms |      117ms |     15714 |           delete from bloattest where mod(b,$1)=$2 |
      |     1 |     67ms |       67ms |    160000 |                              select * from vactest |
      |     1 |     43ms |       43ms |     20000 |         delete from vactest where mod(f1, $1) = $2 |
      |     1 |     26ms |       26ms |         0 |              create table bloattest (a int, b int) |
      |    10 |      2ms |       20ms |         1 | SELECT name, current_database(), COALESCE(default_ |
      |     1 |      7ms |        7ms |         0 |                create index bt_idx on bloattest(b) |
      |    10 |       0s |        6ms |         3 | SELECT funcid, schemaname, funcname, current_datab |
      |    10 |       0s |        3ms |         1 | SELECT S.relid, S.indexrelid, S.schemaname, S.reln |
      |    40 |       0s |        3ms |         1 |                           SELECT pg_table_size($1) |
      |     1 |      2ms |        2ms |     10000 |                            select * from bloattest |
      |    10 |       0s |        2ms |         1 | SELECT relid, schemaname, relname, current_databas |
      |     1 |      1ms |        1ms |         5 | SELECT n.nspname as "Schema",   c.relname as "Name |
      |    10 |       0s |         0s |         1 |                  SELECT pg_total_relation_size($1) |
      |    10 |       0s |         0s |         1 | SELECT T.oid, T.tgrelid, T.tgname, P.proname     F |
      |     1 |       0s |         0s |         0 |       lock table locktest in access exclusive mode |
      |    10 |       0s |         0s |         1 |                          SELECT current_database() |
      |     2 |       0s |         0s |         0 |                                              begin |
      +-------+----------+------------+-----------+----------------------------------------------------+

Table #1 in "bench":
    Name:                bench.public.pgbench_history
    Manual Vacuums:      never
    Manual Analyze:      1, last 23 minutes ago
    Auto Vacuums:        never
    Auto Analyze:        4, last 59 seconds ago
    Post-Analyze:        128.6% est. rows modified
    Row Estimate:        100.0% live of total 27508
    Rows Changed:        ins 100.0%, upd 0.0%, del 0.0%
    HOT Updates:         0.0% of all updates
    Seq Scans:           0, 0.0 rows/scan
    Idx Scans:           0, 0.0 rows/scan
    Cache Hits:          98.7% (idx=0.0%)
    Size:                1.4 MiB

Table #2 in "bench":
    Name:                bench.public.pgbench_tellers
    Manual Vacuums:      3, last 45 seconds ago
    Manual Analyze:      1, last 23 minutes ago
    Auto Vacuums:        5, last 1 second ago
    Auto Analyze:        5, last now
    Post-Analyze:        0.0% est. rows modified
    Row Estimate:        79.5% live of total 1258
    Rows Changed:        ins 0.0%, upd 24.3%, del 0.0%
    HOT Updates:         24.3% of all updates
    Seq Scans:           0, 0.0 rows/scan
    Idx Scans:           163134, 1.0 rows/scan
    Cache Hits:          99.9% (idx=100.0%)
    Size:                4.3 MiB
    Bloat:               5.3 MiB (123.7%)
    +----------------------+---------+------------------+------------+--------+----------------+-------------------+
    |                Index |    Size |            Bloat | Cache Hits |  Scans | Rows Read/Scan | Rows Fetched/Scan |
    +----------------------+---------+------------------+------------+--------+----------------+-------------------+
    | pgbench_tellers_pkey | 1.2 MiB | 5.3 MiB (461.5%) |     100.0% | 163134 |           13.0 |               1.0 |
    +----------------------+---------+------------------+------------+--------+----------------+-------------------+

Table #3 in "bench":
    Name:                bench.public.pgbench_accounts
    Manual Vacuums:      never
    Manual Analyze:      1, last 23 minutes ago
    Auto Vacuums:        never
    Auto Analyze:        never
    Post-Analyze:        1.5% est. rows modified
    Row Estimate:        96.2% live of total 10587503
    Rows Changed:        ins 0.0%, upd 62.0%, del 0.0%
    HOT Updates:         62.0% of all updates
    Seq Scans:           0, 0.0 rows/scan
    Idx Scans:           326268, 1.0 rows/scan
    Cache Hits:          75.1% (idx=93.1%)
    Size:                1.3 GiB
    Bloat:               24 MiB (1.8%)
    +-----------------------+---------+----------------+------------+--------+----------------+-------------------+
    |                 Index |    Size |          Bloat | Cache Hits |  Scans | Rows Read/Scan | Rows Fetched/Scan |
    +-----------------------+---------+----------------+------------+--------+----------------+-------------------+
    | pgbench_accounts_pkey | 214 MiB | 24 MiB (11.3%) |      93.1% | 326268 |            1.2 |               1.0 |
    +-----------------------+---------+----------------+------------+--------+----------------+-------------------+

Table #4 in "bench":
    Name:                bench.public.pgbench_branches
    Manual Vacuums:      3, last 45 seconds ago
    Manual Analyze:      1, last 23 minutes ago
    Auto Vacuums:        5, last now
    Auto Analyze:        5, last now
    Post-Analyze:        0.0% est. rows modified
    Row Estimate:        0.4% live of total 27857
    Rows Changed:        ins 0.0%, upd 62.4%, del 0.0%
    HOT Updates:         62.4% of all updates
    Seq Scans:           2, 100.0 rows/scan
    Idx Scans:           163135, 1.0 rows/scan
    Cache Hits:          100.0% (idx=100.0%)
    Size:                2.0 MiB
    Bloat:               2.5 MiB (126.5%)
    +-----------------------+---------+------------------+------------+--------+----------------+-------------------+
    |                 Index |    Size |            Bloat | Cache Hits |  Scans | Rows Read/Scan | Rows Fetched/Scan |
    +-----------------------+---------+------------------+------------+--------+----------------+-------------------+
    | pgbench_branches_pkey | 800 KiB | 2.5 MiB (325.0%) |     100.0% | 163135 |           83.2 |               0.9 |
    +-----------------------+---------+------------------+------------+--------+----------------+-------------------+

Table #1 in "test":
    Name:                test.public.vactest
    Manual Vacuums:      2, last 1 second ago
    Manual Analyze:      1, last 37 seconds ago
    Auto Vacuums:        never
    Auto Analyze:        1, last 17 minutes ago
    Post-Analyze:        0.0% est. rows modified
    Row Estimate:        100.0% live of total 239881
    Rows Changed:        ins 100.0%, upd 0.0%, del 0.0%
    HOT Updates:         0.0% of all updates
    Seq Scans:           1, 160000.0 rows/scan
    Idx Scans:           0, 0.0 rows/scan
    Cache Hits:          96.8% (idx=0.0%)
    Size:                9.0 MiB
    Bloat:               752 KiB (8.1%)

Table #2 in "test":
    Name:                test.public.seqtest
    Manual Vacuums:      never
    Manual Analyze:      never
    Auto Vacuums:        never
    Auto Analyze:        never
    Post-Analyze:        0.0% est. rows modified
    Row Estimate:        0.0% live of total 0
    Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%
    HOT Updates:         0.0% of all updates
    Seq Scans:           0, 0.0 rows/scan
    Idx Scans:           0, 0.0 rows/scan
    Cache Hits:          0.0% (idx=0.0%)
    Size:                0 B

Table #3 in "test":
    Name:                test.public.trtest
    Manual Vacuums:      never
    Manual Analyze:      never
    Auto Vacuums:        never
    Auto Analyze:        never
    Post-Analyze:        0.0% est. rows modified
    Row Estimate:        0.0% live of total 0
    Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%
    HOT Updates:         0.0% of all updates
    Seq Scans:           0, 0.0 rows/scan
    Idx Scans:           0, 0.0 rows/scan
    Cache Hits:          0.0% (idx=0.0%)
    Size:                0 B

Table #4 in "test":
    Name:                test.public.locktest
    Manual Vacuums:      never
    Manual Analyze:      never
    Auto Vacuums:        never
    Auto Analyze:        never
    Post-Analyze:        0.0% est. rows modified
    Row Estimate:        0.0% live of total 1
    Rows Changed:        ins 100.0%, upd 0.0%, del 0.0%
    HOT Updates:         0.0% of all updates
    Seq Scans:           0, 0.0 rows/scan
    Idx Scans:           0, 0.0 rows/scan
    Cache Hits:          0.0% (idx=0.0%)

Table #5 in "test":
    Name:                test.public.bloattest
    Manual Vacuums:      never
    Manual Analyze:      never
    Auto Vacuums:        1, last 17 minutes ago
    Auto Analyze:        2, last 17 minutes ago
    Post-Analyze:        0.0% est. rows modified
    Row Estimate:        100.0% live of total 62857
    Rows Changed:        ins 70.0%, upd 0.0%, del 30.0%
    HOT Updates:         0.0% of all updates
    Seq Scans:           5, 64857.0 rows/scan
    Idx Scans:           0, 0.0 rows/scan
    Cache Hits:          99.7% (idx=99.9%)
    Size:                3.8 MiB
    Bloat:               3.0 MiB (78.6%)
    +--------+---------+------------------+------------+-------+----------------+-------------------+
    |  Index |    Size |            Bloat | Cache Hits | Scans | Rows Read/Scan | Rows Fetched/Scan |
    +--------+---------+------------------+------------+-------+----------------+-------------------+
    | bt_idx | 2.6 MiB | 3.0 MiB (117.0%) |      99.9% |     0 |            0.0 |               0.0 |
    +--------+---------+------------------+------------+-------+----------------+-------------------+