【PostgreSQL的指标采集工具--pgmetrics】

pgmetrics是用go语言写的一款PostgreSQL的健康监控指标采集软件。可以连接到数据库,获取当前数据库的相关信息,如果连接的是本地数据库,则同时会采集服务器的状态信息。可以把采集的结果以json或者text或者csv的形式存储。

1.下载pgmetrics的软件

https://github.com/rapidloop/pgmetrics/releases

postgres@ubuntu-linux-22-04-desktop:~$ ll pgmetrics_1.16.0_linux_arm64.tar.gz
-rw-r--r-- 1 postgres postgres 4361437 Mar 19 15:37 pgmetrics_1.16.0_linux_arm64.tar.gz
postgres@ubuntu-linux-22-04-desktop:~$ tar -xf pgmetrics_1.16.0_linux_arm64.tar.gz
postgres@ubuntu-linux-22-04-desktop:~$ cd pgmetrics_1.16.0_linux_arm64/
postgres@ubuntu-linux-22-04-desktop:~/pgmetrics_1.16.0_linux_arm64$ ll
total 14872
drwxrwxr-x  2 postgres postgres     4096 Mar 19 15:37 ./
drwxr-x--- 21 postgres postgres     4096 Mar 19 15:37 ../
-rw-r--r--  1 postgres postgres    11357 Feb  3  2023 LICENSE
-rw-r--r--  1 postgres postgres      377 Feb  3  2023 README.md
-rwxr-xr-x  1 postgres postgres 15204352 Oct  4 12:13 pgmetrics*

2.pgmetrics的选项

postgres@ubuntu-linux-22-04-desktop:~/pgmetrics_1.16.0_linux_arm64$ ./pgmetrics --help
pgmetrics collects PostgreSQL information and metrics.Usage:pgmetrics [OPTION]... [DBNAME]General options:-t, --timeout=SECS           individual query timeout in seconds (default: 5)--lock-timeout=MILLIS    lock timeout in milliseconds (default: 50)-i, --input=FILE             don't connect to db, instead read and displaythis previously saved JSON file-V, --version                output version information, then exit-?, --help[=options]         show this help, then exit--help=variables         list environment variables, then exitCollection options:-S, --no-sizes               don't collect tablespace and relation sizes-c, --schema=REGEXP          collect only from schema(s) matching POSIX regexp-C, --exclude-schema=REGEXP  do NOT collect from schema(s) matching POSIX regexp-a, --table=REGEXP           collect only from table(s) matching POSIX regexp-A, --exclude-table=REGEXP   do NOT collect from table(s) matching POSIX regexp--omit=WHAT              do NOT collect the items specified as a comma-separatedlist of: "tables", "indexes", "sequences","functions", "extensions", "triggers","statements", "log", "citus", "indexdefs","bloat"--sql-length=LIMIT       collect only first LIMIT characters of all SQLqueries (default: 500)--statements-limit=LIMIT collect only utmost LIMIT number of row frompg_stat_statements (default: 100)--only-listed            collect info only from the databases listed ascommand-line args (use with Heroku)--all-dbs                collect info from all user databases--log-file               location of PostgreSQL log file--log-dir                read all the PostgreSQL log files in this directory--log-span=MINS          examine the last MINS minutes of logs (default: 5)--aws-rds-dbid           AWS RDS/Aurora database instance identifier--az-resource            Azure resource ID--pgpool                 collect only Pgpool metricsOutput options:-f, --format=FORMAT          output format; "human", "json" or "csv" (default: "human")-l, --toolong=SECS           for human output, transactions running longer thanthis are considered too long (default: 60)-o, --output=FILE            write output to the specified file--no-pager               do not invoke the pager for tty outputConnection options:-h, --host=HOSTNAME          database server host or socket directory(default: "/var/run/postgresql")-p, --port=PORT              database server port (default: 5432)-U, --username=USERNAME      database user name (default: "postgres")-w, --no-password            never prompt for password--role=ROLE              do SET ROLE before collectionFor more information, visit <https://pgmetrics.io>.

3.使用案例

设置超时时间为3s,避免阻塞业务。

postgres@ubuntu-linux-22-04-desktop:~/pgmetrics_1.16.0_linux_arm64$ ./pgmetrics -t 3 --no-password --no-pager  -h /tmp -o ./PostgreSQL_Checklog_`date +"%Y-
%m-%d-%H%M%S"`.log postgres test_upgrade
pgmetrics: warning: failed to guess log file location/access denied, specify explicitly with --log-file or --log-dirpostgres@ubuntu-linux-22-04-desktop:~/pgmetrics_1.16.0_linux_arm64$ ll
total 14912
drwxrwxr-x  2 postgres postgres     4096 Mar 19 15:46 ./
drwxr-x--- 21 postgres postgres     4096 Mar 19 15:42 ../
-rw-r--r--  1 postgres postgres    11357 Feb  3  2023 LICENSE
-rw-rw-r--  1 postgres postgres    37143 Mar 19 15:46 PostgreSQL_Checklog_2024-03-19-154620.log
-rw-r--r--  1 postgres postgres      377 Feb  3  2023 README.md
-rwxr-xr-x  1 postgres postgres 15204352 Oct  4 12:13 pgmetrics*

报告的内容如下


pgmetrics run at: 19 Mar 2024 3:46:20 PM (now)PostgreSQL Cluster:Name:Server Version:      16.1Server Started:      19 Mar 2024 3:22:34 PM (23 minutes ago)System Identifier:   7316572678719819371Timeline:            1Last Checkpoint:     19 Mar 2024 3:22:34 PM (23 minutes ago)REDO LSN:            0/3D1DA560Checkpoint LSN:      0/3D1DA560 (0 B since REDO)Transaction IDs:     oldest = 726, next = 2189, range = 1463Notification Queue:  0.0% usedActive Backends:     1 (max 100)Recovery Mode?       noSystem Information:Hostname:            ubuntu-linux-22-04-desktopCPU Cores:           0 xLoad Average:        0.28Memory:              used=707 MiB, free=218 MiB, buff=251 MiB, cache=564 MiBSwap:                used=167 MiB, free=1.8 GiB+---------------------------------+-----------------+|                         Setting |           Value |+---------------------------------+-----------------+|                  shared_buffers | 16384 (128 MiB) ||                        work_mem |  4096 (4.0 MiB) ||            maintenance_work_mem |  65536 (64 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 |+---------------------------------+-----------------+WAL Files:WAL Archiving?       noWAL Files:           3+--------------------+----------------+|            Setting |          Value |+--------------------+----------------+|          wal_level |        replica ||    archive_timeout |              0 ||    wal_compression |            off ||       max_wal_size | 1024 (1.0 GiB) ||       min_wal_size |    80 (80 MiB) || checkpoint_timeout |            300 ||   full_page_writes |             on ||      wal_keep_size |              0 |+--------------------+----------------+BG Writer:Checkpoint Rate:     0.21 per minAverage Write:       0 B per checkpointTotal Checkpoints:   4 sched (80.0%) + 1 req (20.0%) = 5Total Write:         0 B, @ 0 B per secBuffers Allocated:   842 (6.6 MiB)Buffers Written:     0 chkpt (0.0%) + 0 bgw (0.0%) + 0 be (0.0%)Clean Scan Stops:    0BE fsyncs:           0Counts Since:        19 Mar 2024 3:22:34 PM (23 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 |      300 sec || checkpoint_completion_target |          0.9 |+------------------------------+--------------+Backends:Total Backends:      1 (1.0% of max 100)Problematic:         0 waiting on locks, 0 waiting on other, 0 xact too long, 0 idle in xactLocks:+------------+-------------+-------+|  Lock Type | Not Granted | Total |+------------+-------------+-------+|   relation |           0 |     4 || virtualxid |           0 |     1 |+------------+-------------+-------+|            |           0 |     5 |+------------+-------------+-------+Vacuum Progress:No manual or auto vacuum jobs in progress.+------------------------------+----------------+|                      Setting |          Value |+------------------------------+----------------+|         maintenance_work_mem | 65536 (64 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 |+-----------------------------+-------+------+-------+-----------+----------+------------+---------+-------------------------+-------------------------
-------------------------------------+|                    postgres |   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 |                         |||               pg_checkpoint |       |      |       |           |          |            |     yes |                         ||| pg_use_reserved_connections |       |      |       |           |          |            |     yes |                         |||        pg_read_server_files |       |      |       |           |          |            |     yes |                         |||       pg_write_server_files |       |      |       |           |          |            |     yes |                         |||   pg_execute_server_program |       |      |       |           |          |            |     yes |                         |||           pg_database_owner |       |      |       |           |          |            |     yes |                         |||            pg_read_all_data |       |      |       |           |          |            |     yes |                         |||           pg_write_all_data |       |      |       |           |          |            |     yes |                         |||      pg_create_subscription |       |      |       |           |          |            |     yes |                         |||                        repl |   yes |  yes |       |           |          |            |     yes |                         |||                        ysla |   yes |      |       |           |          |            |     yes |                         |||                      test10 |   yes |      |       |           |          |            |     yes | 17 Aug 2024 12:40:09 PM |||                      test11 |   yes |      |       |           |          |            |     yes |  23 Feb 2024 1:57:19 PM ||+-----------------------------+-------+------+-------+-----------+----------+------------+---------+-------------------------+-------------------------
-------------------------------------+Tablespaces:+------------+----------+----------------------------------+---------+--------------------------+---------------------------+|       Name |    Owner |                         Location |    Size |                Disk Used |                Inode Used |+------------+----------+----------------------------------+---------+--------------------------+---------------------------+| pg_default | postgres | $PGDATA = /home/postgres/data-16 |  33 MiB | 27 GiB (43.7%) of 62 GiB | 419716 (10.2%) of 4128768 ||  pg_global | postgres | $PGDATA = /home/postgres/data-16 | 588 KiB | 27 GiB (43.7%) of 62 GiB | 419716 (10.2%) of 4128768 |+------------+----------+----------------------------------+---------+--------------------------+---------------------------+Database #1:Name:                postgresOwner:               postgresTablespace:          pg_defaultConnections:         1 (no max limit)Frozen Xid Age:      1463Transactions:        71 (100.0%) commits, 0 (0.0%) rollbacksCache Hits:          96.0%Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%Total Temp:          0 B in 0 filesProblems:            0 deadlocks, 0 conflictsTotals Since:Size:                12 MiBSequences:+------------------------------+------------+|                     Sequence | Cache Hits |+------------------------------+------------+|                 hints_id_seq |            ||       student_student_id_seq |            ||  test_vaccum_index_on_id_seq |            || test_vaccum_index_off_id_seq |            |+------------------------------+------------+Installed Extensions:+--------------------+---------+------------------------------------------------------------------------+|               Name | Version |                                                                Comment |+--------------------+---------+------------------------------------------------------------------------+|            pg_bigm |     1.2 |       text similarity measurement and index searching based on bigrams ||       pg_hint_plan |   1.4.2 |                                                                        || pg_stat_statements |     1.9 | track planning and execution statistics of all SQL statements executed ||            pg_trgm |     1.6 |      text similarity measurement and index searching based on trigrams ||           pgcrypto |     1.3 |                                                cryptographic functions ||            plpgsql |     1.0 |                                           PL/pgSQL procedural language |+--------------------+---------+------------------------------------------------------------------------+Slow Queries:+-------+----------+------------+-----------+----------------------------------------------------+| Calls | Avg Time | Total Time | Rows/Call |                                              Query |+-------+----------+------------+-----------+----------------------------------------------------+|     4 |      4ms |       17ms |         1 |                        SELECT pg_database_size($1) ||     4 |      3ms |       13ms |         1 |                      SELECT pg_tablespace_size($1) ||     1 |      9ms |        9ms |         9 | SELECT   current_database() AS db, schemaname, tab ||     2 |      2ms |        5ms |       378 | SELECT name, setting, COALESCE(boot_val,$1), sourc ||     2 |      2ms |        4ms |        19 | SELECT S.relid, S.schemaname, S.relname, current_d ||     2 |      1ms |        3ms |         0 | SELECT funcid, schemaname, funcname, current_datab ||     2 |      1ms |        2ms |         6 | SELECT name, current_database(), COALESCE(default_ ||     2 |       0s |        1ms |         1 | SELECT EXTRACT($1 FROM pg_postmaster_start_time()) ||     2 |       0s |         0s |         1 | SELECT COALESCE(datname, $2), COALESCE(usename, $3 ||     1 |       0s |         0s |         4 | SELECT   d.datname as "Name",   pg_catalog.pg_get_ ||     2 |       0s |         0s |         5 | SELECT COALESCE(D.datname, $1), L.locktype, L.mode ||     2 |       0s |         0s |        12 | SELECT S.relid, S.indexrelid, S.schemaname, S.reln ||     2 |       0s |         0s |        12 | SELECT indexrelid, pg_get_indexdef(indexrelid) FRO ||     1 |       0s |         0s |        44 | SELECT userid, dbid, queryid, LEFT(COALESCE(query, ||     2 |       0s |         0s |         3 |    SELECT name FROM pg_ls_waldir() WHERE name ~ $1 ||     2 |       0s |         0s |         1 | SELECT checkpoints_timed, checkpoints_req, checkpo ||     2 |       0s |         0s |        19 | SELECT R.oid, R.rolname, R.rolsuper, R.rolinherit, ||     2 |       0s |         0s |         2 | SELECT c.oid, i.inhparent::regclass    FROM pg_cla ||     2 |       0s |         0s |         0 | SELECT c.oid, inhparent::regclass, COALESCE(pg_get ||     2 |       0s |         0s |         0 | SELECT COALESCE(usename, $1), application_name,    ||     2 |       0s |         0s |         1 | SELECT checkpoint_lsn, redo_lsn, timeline_id,    n ||     2 |       0s |         0s |         2 | SELECT oid, spcname, pg_get_userbyid(spcowner),    ||     2 |       0s |         0s |         2 | SELECT D.oid, D.datname, D.datdba, D.dattablespace ||     2 |       0s |         0s |         1 |  SELECT system_identifier FROM pg_control_system() ||     2 |       0s |         0s |         1 | SELECT pg_is_in_recovery(),    COALESCE(pg_last_wa ||     2 |       0s |         0s |         1 | SELECT archived_count,     COALESCE(last_archived_ ||     2 |       0s |         0s |         4 | SELECT relid, schemaname, relname, current_databas ||     2 |       0s |         0s |         1 |                                SELECT current_user ||     2 |       0s |         0s |         6 | SELECT backend_type, count(*) FROM pg_stat_activit ||     2 |       0s |         0s |         1 | SELECT COUNT(*) FROM pg_ls_archive_statusdir() WHE ||     2 |       0s |         0s |         0 | SELECT pid, datname, relid::int, COALESCE(command, ||     2 |       0s |         0s |         0 | WITH P AS (SELECT DISTINCT pid FROM pg_locks WHERE ||     2 |       0s |         0s |         0 | SELECT status, receive_start_lsn, receive_start_tl ||     2 |       0s |         0s |         1 | SELECT wal_records, wal_fpi, wal_bytes, wal_buffer ||     2 |       0s |         0s |         0 | SELECT slot_name, COALESCE(plugin, $1), slot_type, ||     2 |       0s |         0s |         1 |         SELECT COALESCE(pg_current_logfile($1),$2) ||     2 |       0s |         0s |         1 |               SELECT pg_notification_queue_usage() ||     2 |       0s |         0s |         0 | SELECT pid, datname, COALESCE(relid, $1), COALESCE ||     2 |       0s |         0s |         1 | SELECT COALESCE(inet_client_addr() = inet_server_a ||     2 |       0s |         0s |         0 | SELECT pid, datname, relid::int, COALESCE(command, ||     2 |       0s |         0s |         0 | SELECT pid, datname, COALESCE(relid::int, $1::int) ||     2 |       0s |         0s |         0 | SELECT pid, datname, relid::int, index_relid::int, ||     2 |       0s |         0s |         0 | SELECT pid, COALESCE(phase, $1),      COALESCE(bac ||     2 |       0s |         0s |         1 | SELECT pg_current_wal_flush_lsn(),     pg_current_ ||     2 |       0s |         0s |         1 |                          SELECT current_database() ||     2 |       0s |         0s |         0 | SELECT T.oid, T.tgrelid, T.tgname, P.proname     F ||     1 |       0s |         0s |         0 | WITH pc AS (SELECT pubname, COUNT(*) AS c FROM pg_ ||     1 |       0s |         0s |         0 | WITH     sc AS (SELECT srsubid, COUNT(*) AS c FROM |+-------+----------+------------+-----------+----------------------------------------------------+Database #2:Name:                test_upgradeOwner:               postgresTablespace:          pg_defaultConnections:         0 (no max limit)Frozen Xid Age:      1463Transactions:        18 (100.0%) commits, 0 (0.0%) rollbacksCache Hits:          95.6%Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%Total Temp:          0 B in 0 filesProblems:            0 deadlocks, 0 conflictsTotals Since:Size:                7.3 MiBInstalled Extensions:+---------+---------+-------------------------------------------------------------------+|    Name | Version |                                                           Comment |+---------+---------+-------------------------------------------------------------------+| pg_bigm |     1.2 |  text similarity measurement and index searching based on bigrams || pg_trgm |     1.6 | text similarity measurement and index searching based on trigrams || plpgsql |     1.0 |                                      PL/pgSQL procedural language |+---------+---------+-------------------------------------------------------------------+Slow Queries:+-------+----------+------------+-----------+----------------------------------------------------+| Calls | Avg Time | Total Time | Rows/Call |                                              Query |+-------+----------+------------+-----------+----------------------------------------------------+|     1 |      7ms |        7ms |         7 | SELECT   current_database() AS db, schemaname, tab ||     1 |      3ms |        3ms |         0 | SELECT funcid, schemaname, funcname, current_datab ||     1 |       0s |         0s |         2 | SELECT S.relid, S.schemaname, S.relname, current_d ||     1 |       0s |         0s |         3 | SELECT name, current_database(), COALESCE(default_ ||     1 |       0s |         0s |         0 | SELECT S.relid, S.indexrelid, S.schemaname, S.reln ||     1 |       0s |         0s |         0 | SELECT indexrelid, pg_get_indexdef(indexrelid) FRO ||     1 |       0s |         0s |         0 | SELECT relid, schemaname, relname, current_databas ||     1 |       0s |         0s |         1 |                          SELECT current_database() ||     1 |       0s |         0s |         0 | WITH pc AS (SELECT pubname, COUNT(*) AS c FROM pg_ ||     1 |       0s |         0s |         0 | WITH     sc AS (SELECT srsubid, COUNT(*) AS c FROM ||     1 |       0s |         0s |         0 | SELECT T.oid, T.tgrelid, T.tgname, P.proname     F ||     1 |       0s |         0s |         0 | SELECT c.oid, inhparent::regclass, COALESCE(pg_get ||     1 |       0s |         0s |         0 | SELECT c.oid, i.inhparent::regclass    FROM pg_cla |+-------+----------+------------+-----------+----------------------------------------------------+Table #1 in "postgres":Name:                postgres.hint_plan.hintsColumns:             4Manual Vacuums:      neverManual Analyze:      neverAuto Vacuums:        neverAuto Analyze:        neverPost-Analyze:        0.0% est. rows modifiedRow Estimate:        0.0% live of total 0Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%HOT Updates:         0.0% of all updatesSeq Scans:           0, 0.0 rows/scanIdx Scans:           0, 0.0 rows/scanCache Hits:          0.0% (idx=0.0%)Size:                8.0 KiBACL:+----------+---------------------------------------------------------------+------------+|     Role |                                                    Privileges | Granted By |+----------+---------------------------------------------------------------+------------+| postgres | INSERT, SELECT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER |   postgres ||   PUBLIC |                                                        SELECT |   postgres |+----------+---------------------------------------------------------------+------------++--------------------+-------+---------+-------+------------+-------+----------------+-------------------+|              Index |  Type |    Size | Bloat | Cache Hits | Scans | Rows Read/Scan | Rows Fetched/Scan |+--------------------+-------+---------+-------+------------+-------+----------------+-------------------+|         hints_pkey | btree | 8.0 KiB |       |            |     0 |            0.0 |               0.0 || hints_norm_and_app | btree | 8.0 KiB |       |            |     0 |            0.0 |               0.0 |+--------------------+-------+---------+-------+------------+-------+----------------+-------------------+Table #2 in "postgres":Name:                postgres.public.tab_test_1Columns:             1Manual Vacuums:      neverManual Analyze:      neverAuto Vacuums:        neverAuto Analyze:        neverPost-Analyze:        0.0% est. rows modifiedRow Estimate:        0.0% live of total 0Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%HOT Updates:         0.0% of all updatesSeq Scans:           0, 0.0 rows/scanIdx Scans:           0, 0.0 rows/scanCache Hits:          0.0% (idx=0.0%)Size:                8.0 KiB+-------+-------+--------+-------+------------+-------+----------------+-------------------+| Index |  Type |   Size | Bloat | Cache Hits | Scans | Rows Read/Scan | Rows Fetched/Scan |+-------+-------+--------+-------+------------+-------+----------------+-------------------+| idx_1 | btree | 16 KiB |       |            |     0 |            0.0 |               0.0 |+-------+-------+--------+-------+------------+-------+----------------+-------------------+Table #3 in "postgres":Name:                postgres.public.tab_test_2Columns:             1Manual Vacuums:      neverManual Analyze:      neverAuto Vacuums:        neverAuto Analyze:        neverPost-Analyze:        0.0% est. rows modifiedRow Estimate:        0.0% live of total 0Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%HOT Updates:         0.0% of all updatesSeq Scans:           0, 0.0 rows/scanIdx Scans:           0, 0.0 rows/scanCache Hits:          0.0% (idx=0.0%)Size:                8.0 KiBTable #4 in "postgres":Name:                postgres.public.tab_testdumpColumns:             3Manual Vacuums:      neverManual Analyze:      neverAuto Vacuums:        neverAuto Analyze:        neverPost-Analyze:        0.0% est. rows modifiedRow Estimate:        0.0% live of total 0Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%HOT Updates:         0.0% of all updatesSeq Scans:           0, 0.0 rows/scanIdx Scans:           0, 0.0 rows/scanCache Hits:          0.0% (idx=0.0%)Size:                16 KiBTable #5 in "postgres":Name:                postgres.public.tab_1Columns:             3Manual Vacuums:      neverManual Analyze:      neverAuto Vacuums:        neverAuto Analyze:        neverPost-Analyze:        0.0% est. rows modifiedRow Estimate:        0.0% live of total 0Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%HOT Updates:         0.0% of all updatesSeq Scans:           0, 0.0 rows/scanIdx Scans:           0, 0.0 rows/scanCache Hits:          0.0% (idx=0.0%)Size:                16 KiB+-------+-------+--------+-------+------------+-------+----------------+-------------------+| Index |  Type |   Size | Bloat | Cache Hits | Scans | Rows Read/Scan | Rows Fetched/Scan |+-------+-------+--------+-------+------------+-------+----------------+-------------------+|  idx1 | btree | 16 KiB |       |            |     0 |            0.0 |               0.0 ||  idx2 | btree | 16 KiB |       |            |     0 |            0.0 |               0.0 |+-------+-------+--------+-------+------------+-------+----------------+-------------------+Table #6 in "postgres":Name:                postgres.public.test_default_1Columns:             2Manual Vacuums:      neverManual Analyze:      neverAuto Vacuums:        neverAuto Analyze:        neverPost-Analyze:        0.0% est. rows modifiedRow Estimate:        0.0% live of total 0Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%HOT Updates:         0.0% of all updatesSeq Scans:           0, 0.0 rows/scanIdx Scans:           0, 0.0 rows/scanCache Hits:          0.0% (idx=0.0%)Size:                8.0 KiBTable #7 in "postgres":Name:                postgres.public.test_default_2Columns:             2Manual Vacuums:      neverManual Analyze:      neverAuto Vacuums:        neverAuto Analyze:        neverPost-Analyze:        0.0% est. rows modifiedRow Estimate:        0.0% live of total 0Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%HOT Updates:         0.0% of all updatesSeq Scans:           0, 0.0 rows/scanIdx Scans:           0, 0.0 rows/scanCache Hits:          0.0% (idx=0.0%)Size:                8.0 KiBTable #8 in "postgres":Name:                postgres.public.test_default_3Columns:             2Manual Vacuums:      neverManual Analyze:      neverAuto Vacuums:        neverAuto Analyze:        neverPost-Analyze:        0.0% est. rows modifiedRow Estimate:        0.0% live of total 0Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%HOT Updates:         0.0% of all updatesSeq Scans:           0, 0.0 rows/scanIdx Scans:           0, 0.0 rows/scanCache Hits:          0.0% (idx=0.0%)Size:                16 KiBTable #9 in "postgres":Name:                postgres.public.tab_xmaster_yslColumns:             2Manual Vacuums:      neverManual Analyze:      neverAuto Vacuums:        neverAuto Analyze:        neverPost-Analyze:        0.0% est. rows modifiedRow Estimate:        0.0% live of total 0Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%HOT Updates:         0.0% of all updatesSeq Scans:           0, 0.0 rows/scanIdx Scans:           0, 0.0 rows/scanCache Hits:          0.0% (idx=0.0%)Size:                8.0 KiBTable #10 in "postgres":Name:                postgres.public.studentColumns:             3Manual Vacuums:      neverManual Analyze:      neverAuto Vacuums:        neverAuto Analyze:        neverPost-Analyze:        0.0% est. rows modifiedRow Estimate:        0.0% live of total 0Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%HOT Updates:         0.0% of all updatesSeq Scans:           0, 0.0 rows/scanIdx Scans:           0, 0.0 rows/scanCache Hits:          0.0% (idx=0.0%)Size:                0 BTable #11 in "postgres":Name:                postgres.public.student_qualifiedInherits from:       studentColumns:             3Manual Vacuums:      neverManual Analyze:      neverAuto Vacuums:        neverAuto Analyze:        neverPost-Analyze:        0.0% est. rows modifiedRow Estimate:        0.0% live of total 0Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%HOT Updates:         0.0% of all updatesSeq Scans:           0, 0.0 rows/scanIdx Scans:           0, 0.0 rows/scanCache Hits:          0.0% (idx=0.0%)Size:                0 BTable #12 in "postgres":Name:                postgres.public.student_nqualifiedInherits from:       studentColumns:             3Manual Vacuums:      neverManual Analyze:      neverAuto Vacuums:        neverAuto Analyze:        neverPost-Analyze:        0.0% est. rows modifiedRow Estimate:        0.0% live of total 0Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%HOT Updates:         0.0% of all updatesSeq Scans:           0, 0.0 rows/scanIdx Scans:           0, 0.0 rows/scanCache Hits:          0.0% (idx=0.0%)Size:                0 BTable #13 in "postgres":Name:                postgres.public.test_vaccum_index_onColumns:             3Manual Vacuums:      neverManual Analyze:      neverAuto Vacuums:        neverAuto Analyze:        neverPost-Analyze:        0.0% est. rows modifiedRow Estimate:        0.0% live of total 0Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%HOT Updates:         0.0% of all updatesSeq Scans:           0, 0.0 rows/scanIdx Scans:           0, 0.0 rows/scanCache Hits:          0.0% (idx=0.0%)Size:                48 KiB+----------------------------+-------+--------+-------+------------+-------+----------------+-------------------+|                      Index |  Type |   Size | Bloat | Cache Hits | Scans | Rows Read/Scan | Rows Fetched/Scan |+----------------------------+-------+--------+-------+------------+-------+----------------+-------------------+|  test_vaccum_index_on_pkey | btree | 16 KiB |       |            |     0 |            0.0 |               0.0 || test_vaccum_index_on_x_key | btree | 16 KiB |       |            |     0 |            0.0 |               0.0 ||                          z | btree | 16 KiB |       |            |     0 |            0.0 |               0.0 |+----------------------------+-------+--------+-------+------------+-------+----------------+-------------------+Table #14 in "postgres":Name:                postgres.public.test_vaccum_index_offColumns:             3Manual Vacuums:      neverManual Analyze:      neverAuto Vacuums:        neverAuto Analyze:        neverPost-Analyze:        0.0% est. rows modifiedRow Estimate:        0.0% live of total 0Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%HOT Updates:         0.0% of all updatesSeq Scans:           0, 0.0 rows/scanIdx Scans:           0, 0.0 rows/scanCache Hits:          0.0% (idx=0.0%)Size:                48 KiB+-----------------------------+-------+--------+-------+------------+-------+----------------+-------------------+|                       Index |  Type |   Size | Bloat | Cache Hits | Scans | Rows Read/Scan | Rows Fetched/Scan |+-----------------------------+-------+--------+-------+------------+-------+----------------+-------------------+|  test_vaccum_index_off_pkey | btree | 16 KiB |       |            |     0 |            0.0 |               0.0 || test_vaccum_index_off_x_key | btree | 16 KiB |       |            |     0 |            0.0 |               0.0 ||                          z2 | btree | 16 KiB |       |            |     0 |            0.0 |               0.0 |+-----------------------------+-------+--------+-------+------------+-------+----------------+-------------------+Table #15 in "postgres":Name:                postgres.public.testColumns:             1Manual Vacuums:      neverManual Analyze:      neverAuto Vacuums:        neverAuto Analyze:        neverPost-Analyze:        0.0% est. rows modifiedRow Estimate:        0.0% live of total 0Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%HOT Updates:         0.0% of all updatesSeq Scans:           0, 0.0 rows/scanIdx Scans:           0, 0.0 rows/scanCache Hits:          0.0% (idx=0.0%)Size:                1.8 MiBBloat:               888 KiB (49.1%)+-----------+-------+---------+-----------------+------------+-------+----------------+-------------------+|     Index |  Type |    Size |           Bloat | Cache Hits | Scans | Rows Read/Scan | Rows Fetched/Scan |+-----------+-------+---------+-----------------+------------+-------+----------------+-------------------+| test_pkey | btree | 2.2 MiB | 1.4 MiB (64.5%) |            |     0 |            0.0 |               0.0 |+-----------+-------+---------+-----------------+------------+-------+----------------+-------------------+Table #16 in "postgres":Name:                postgres.public.tColumns:             1Manual Vacuums:      neverManual Analyze:      neverAuto Vacuums:        neverAuto Analyze:        neverPost-Analyze:        0.0% est. rows modifiedRow Estimate:        0.0% live of total 0Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%HOT Updates:         0.0% of all updatesSeq Scans:           0, 0.0 rows/scanIdx Scans:           0, 0.0 rows/scanCache Hits:          0.0% (idx=0.0%)Size:                8.0 KiBTable #17 in "postgres":Name:                postgres.public.test_dataColumns:             1Manual Vacuums:      neverManual Analyze:      neverAuto Vacuums:        neverAuto Analyze:        neverPost-Analyze:        0.0% est. rows modifiedRow Estimate:        0.0% live of total 0Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%HOT Updates:         0.0% of all updatesSeq Scans:           0, 0.0 rows/scanIdx Scans:           0, 0.0 rows/scanCache Hits:          0.0% (idx=0.0%)Size:                8.0 KiBTable #18 in "postgres":Name:                postgres.public.t2Columns:             1Manual Vacuums:      neverManual Analyze:      neverAuto Vacuums:        neverAuto Analyze:        neverPost-Analyze:        0.0% est. rows modifiedRow Estimate:        0.0% live of total 0Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%HOT Updates:         0.0% of all updatesSeq Scans:           0, 0.0 rows/scanIdx Scans:           0, 0.0 rows/scanCache Hits:          0.0% (idx=0.0%)Size:                16 KiBTable #19 in "postgres":Name:                postgres.public.t3Columns:             1Manual Vacuums:      neverManual Analyze:      neverAuto Vacuums:        neverAuto Analyze:        neverPost-Analyze:        0.0% est. rows modifiedRow Estimate:        0.0% live of total 0Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%HOT Updates:         0.0% of all updatesSeq Scans:           0, 0.0 rows/scanIdx Scans:           0, 0.0 rows/scanCache Hits:          0.0% (idx=0.0%)Size:                16 KiBTable #1 in "test_upgrade":Name:                test_upgrade.public.test01Columns:             2Manual Vacuums:      neverManual Analyze:      neverAuto Vacuums:        neverAuto Analyze:        neverPost-Analyze:        0.0% est. rows modifiedRow Estimate:        0.0% live of total 0Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%HOT Updates:         0.0% of all updatesSeq Scans:           0, 0.0 rows/scanIdx Scans:           0, 0.0 rows/scanCache Hits:          0.0% (idx=0.0%)Size:                8.0 KiBTable #2 in "test_upgrade":Name:                test_upgrade.public.txaColumns:             1Manual Vacuums:      neverManual Analyze:      neverAuto Vacuums:        neverAuto Analyze:        neverPost-Analyze:        0.0% est. rows modifiedRow Estimate:        0.0% live of total 0Rows Changed:        ins 0.0%, upd 0.0%, del 0.0%HOT Updates:         0.0% of all updatesSeq Scans:           0, 0.0 rows/scanIdx Scans:           0, 0.0 rows/scanCache Hits:          0.0% (idx=0.0%)Size:                0 B

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/759839.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Mysql主从之keepalive+MySQL高可用

一、Keepalived概述 keepalived 是集群管理中保证集群高可用的一个服务软件&#xff0c;用来防止单点故障。 keepalived 是以VRRP 协议为实现基础的&#xff0c;VRRP 全称VirtualRouter Redundancy Protocol&#xff0c;即虚拟路由冗余协议。虚拟路由冗余协议&#xff0c;可以…

计算机网络题,网上的记录下,计算题

1.8 级信号级别方案被用在一个 10 MHz频率波段中发送信息&#xff0c;数据传输最大比特率是多少&#xff1f;不考虑噪声。 8级信号需三个比特位&#xff0c;根据奈奎斯特准则&#xff0c;10MHz频段对应最大的波特率为20MBauds。最大比特率为20Mlog(2)860Mbps. 2.北美和日本主要…

关于: .sync修饰符

.sync修饰符用于简化父组件与子组件之间双向绑定的语法。通过使用.sync修饰符&#xff0c;可以将子组件中对父组件属性的修改直接同步到父组件中&#xff0c;而无需显式地在子组件中触发事件来更新父组件的属性。.sync修饰符的作用是使双向绑定在父子组件之间更加直观和简洁。 …

武汉星起航领航中国跨境电商,助推全球贸易新篇章

在全球经济一体化的浪潮中&#xff0c;跨境电商以其独特的优势成为推动国际贸易增长的重要引擎。作为中国跨境电商行业的领军者&#xff0c;武汉星起航电子商务有限公司以其卓越的能力和经验&#xff0c;正积极推动中国跨境电商走向世界&#xff0c;书写全球贸易的新篇章。 自…

C#与三菱PLC网络模块通讯

一、操作 1.1 打开以太网模块 参数——网络参数——以太网 1.2 设置以太网模块 运行设置配置IP&#xff0c;打开设置配置端口号 1.3 设置端口号 上位机C#与PLC通讯&#xff0c;打开方式:Unpassive&#xff0c;固定缓冲:发送 二、打开方式说明 2.1 Active PLC主动连接&#xff0…

粒子群优化算法||粒子群算法||Improved particle swarm optimization algorithm求解函数值

粒子群算法&#xff08;Particle Swarm Optimization&#xff0c;PSO&#xff09;是一种基于群体智能的优化算法&#xff0c;其思想来源于鸟群寻食和鱼群捕食等自然现象。PSO算法通过模拟群体智能的行为&#xff0c;以一种启发式的方式寻找最优解&#xff0c;因此具有全局搜索能…

leetcode 18.四数之和 java

题目 思路 整体在三数之和的基础上进行修改。&#xff08;所有需要修改的地方&#xff0c;我在代码里加了//改 的注释&#xff09; 大的一个思路就是&#xff0c;在三数之和的外面再套一层循环。相当于固定前两个数。然后这道题目标值变成一个参数了&#xff0c;不是三数之和…

termux安装

termux安装Python和postgres 安装python 安装pg数据库

语音神经科学—05. Human cortical encoding of pitch in tonal and non-tonal languages

Human cortical encoding of pitch in tonal and non-tonal languages&#xff08;在音调语音和非音调语言中人类大脑皮层的音高编码&#xff09; 专业术语 tonal language 音调语言 pitch 音高 lexical tone 词汇音调 anatomical properties 解刨学特性 temporal lobe 颞叶 s…

C语言数组与指针的区别是什么?

一、问题 常听说数组实质就是指针&#xff0c;是这样的吗&#xff1f; 二、解答 数组是⼀组数&#xff0c;这组数⽤下标相区分&#xff0c;例如&#xff1a; int a[5] {1, 3, 5, 4, 8}; 产⽣5个数&#xff0c;这5个数是 a[0]、a[1]、…、a[4]。 指针是⼀个变量的地址。例如&…

刷题DAY28 | LeetCode 93-复原IP地址 78-子集 90-子集II

93 复原IP地址&#xff08;medium&#xff09; 有效 IP 地址 正好由四个整数&#xff08;每个整数位于 0 到 255 之间组成&#xff0c;且不能含有前导 0&#xff09;&#xff0c;整数之间用 ‘.’ 分隔。 例如&#xff1a;“0.1.2.201” 和 “192.168.1.1” 是 有效 IP 地址&…

基于Java的桃花峪滑雪场租赁系统(Vue.js+SpringBoot)

目录 一、摘要1.1 项目介绍1.2 项目录屏 二、功能模块2.1 游客服务2.2 雪场管理 三、数据库设计3.1 教练表3.2 教练聘请表3.3 押金规则表3.4 器材表3.5 滑雪场表3.7 售票表3.8 器材损坏表 四、系统展示五、核心代码5.1 查询教练5.2 教练聘请5.3 查询滑雪场5.4 滑雪场预定5.5 新…

算法打卡day22|回溯法篇02|Leetcode 216.组合总和III、17.电话号码的字母组合

算法题 Leetcode 216.组合总和III 题目链接:216.组合总和III 大佬视频讲解&#xff1a;组合总和III视频讲解 个人思路 在昨日做过的组合问题后&#xff0c;这道题的限制 多了两个&#xff1a;1.要找到和为n的k个数的组合&#xff0c;2.整个集合已经是固定的了[1,...,9]&…

用Python直接获取Word文档页数、字数、段落数、节数等信息

计算 Word 文档的页数、字数等信息是出版、学术和内容管理等领域的一项基本任务。准确的页数和字数对于评估文档长度、估算印刷成本、分析文本复杂性以及确保符合格式化指南至关重要。逐个预览文档查看相关信息是非常麻烦的事情&#xff0c;我们可以在不预览文档的情况下&#…

分享一篇Oracle RAC实战安装11G

分享一次很久以前的Oracle rac项目实施。 1、拓扑结构 基础环境是2台H3C的服务器2台3PAR的双活存储&#xff0c;操作系统centos7.2。借用下别人家的拓扑先&#xff08;这是一套典型的RAC架构&#xff09;。 2、网卡TEAM操作 以eno51和en052组成Team1组为示例&#xff1a; nm…

如何干好驻场运维服务

驻场运维包括第三方公司派遣&#xff0c;自己公司派遣的运维人员到用户现场处理问题。 其中有软件系统运维服务&#xff0c;基础环境运维服务&#xff0c;网络运维服务等。 以驻场的方式提供服务的形式。 驻场运维是一种趋势。 为什么要以驻场的形式去服务&#xff1f; 响应…

第十二届蓝桥杯大赛软件赛决赛C/C++ 研究生组-纯质数

直接判断数据过大 相对而言&#xff0c;由2&#xff0c;3&#xff0c;5&#xff0c;7组成的数更少&#xff0c;则先筛选出由2,3,5,7组成的数&#xff0c;再判断这些数中的质数个数即可 #include <iostream> using namespace std; int main() {printf("1903");…

3.7 RK3399项目开发实录-板载OpenWRT系统的使用(wulianjishu666)

STM32F103单片机从零到项目开发程序实例 下载链接&#xff1a;https://pan.baidu.com/s/1dWNskNinrMk4bxaE-jgHhQ?pwdymn3 1. OpenWRT 手册 1.1. 支持设备列表 主控板卡型号RK3568ROC-RK3568-PC/Station-P2 1.2. 登录 IP 、登录密码和 WIFI 名称 固件默认登录 IP 为 192.1…

化妆品行业电商数据分析

随着互联网经济的高速发展&#xff0c;电商已经成为化妆品经营的主要渠道之一。根据网络数据显示&#xff0c;11月全国化妆品网络活跃商品200万&#xff0c;零售总额为400亿。分区域来看&#xff0c;上海市、广东省、浙江省化妆品行业网络零售突出&#xff0c;三个区域网络零售…

2024.3.9|第十五届蓝桥杯模拟赛(第三期)

2024.3.9|十五届蓝桥杯模拟赛&#xff08;第三期&#xff09; 第一题 第二题 第三题 第四题 第五题 第六题 第七题 第八题 第九题 第十题 心有猛虎&#xff0c;细嗅蔷薇。你好朋友&#xff0c;这里是锅巴的C\C学习笔记&#xff0c;常言道&#xff0c;不积跬步无以至千里&…