バージョンごとのドキュメント一覧

28.2. 累積統計システム #

<title>The Cumulative Statistics System</title>

<productname>PostgreSQL</productname>'s <firstterm>cumulative statistics system</firstterm> supports collection and reporting of information about server activity. Presently, accesses to tables and indexes in both disk-block and individual-row terms are counted. The total number of rows in each table, and information about vacuum and analyze actions for each table are also counted. If enabled, calls to user-defined functions and the total time spent in each one are counted as well. PostgreSQL累積統計システムは、サーバ活動に関する情報の収集と報告をサポートしています。 現在、コレクタはテーブルとインデックスへのアクセスをディスクブロックおよび個々の行単位で数えることができます。 またこれは、各テーブル内の総行数、および、各テーブルでのバキュームやアナライズの実施情報を数えます。 有効になっている場合は、ユーザ定義関数の呼ばれた回数、それぞれの消費した総時間を数えます。

<productname>PostgreSQL</productname> also supports reporting dynamic information about exactly what is going on in the system right now, such as the exact command currently being executed by other server processes, and which other connections exist in the system. This facility is independent of the cumulative statistics system. また、PostgreSQLは他のサーバプロセスによって現在実行されている正確なコマンドなど現在システム内で起きていること、またシステム内にどんな他の接続が存在するかということについての動的情報を正確に報告する機能を持ちます。 これは累積統計システムから独立している機能です。

28.2.1. 統計情報収集のための設定 #

<title>Statistics Collection Configuration</title>

Since collection of statistics adds some overhead to query execution, the system can be configured to collect or not collect information. This is controlled by configuration parameters that are normally set in <filename>postgresql.conf</filename>. (See <xref linkend="runtime-config"/> for details about setting configuration parameters.) 統計情報の収集によって問い合わせの実行に少しオーバーヘッドが加わりますので、システムは情報を収集するようにもしないようにも設定できます。 これは通常はpostgresql.conf内で設定される、設定パラメータによって制御されます。 (設定パラメータの設定についての詳細は第20章を参照してください。)

The parameter <xref linkend="guc-track-activities"/> enables monitoring of the current command being executed by any server process. track_activitiesパラメータは、任意のサーバプロセスで現在実行されているコマンドを監視するかどうかを指定できます。

The parameter <xref linkend="guc-track-counts"/> controls whether cumulative statistics are collected about table and index accesses. track_countsパラメータは、テーブルおよびインデックスアクセスに関する累積統計を収集するかどうかを制御します。

The parameter <xref linkend="guc-track-functions"/> enables tracking of usage of user-defined functions. track_functionsパラメータは、ユーザ定義関数の使用状況を追跡するかどうかを指定できます。

The parameter <xref linkend="guc-track-io-timing"/> enables monitoring of block read and write times. track_io_timingパラメータは、ブロック読み取りおよび書き込み時間を監視するかどうかを指定できます。

The parameter <xref linkend="guc-track-wal-io-timing"/> enables monitoring of WAL write times. track_wal_io_timingパラメータは、WALの書き込み時間を監視するかどうかを指定できます。

Normally these parameters are set in <filename>postgresql.conf</filename> so that they apply to all server processes, but it is possible to turn them on or off in individual sessions using the <xref linkend="sql-set"/> command. (To prevent ordinary users from hiding their activity from the administrator, only superusers are allowed to change these parameters with <command>SET</command>.) 通常、これらの変数は全てのサーバプロセスに適用できるようにpostgresql.conf内で設定されます。 しかし、SETコマンドを使用して、個別のセッションで有効または無効にできます。 (一般ユーザがその活動を管理者から隠すことを防止するために、スーパーユーザのみがSETを使用してこれらのパラメータを変更できます。)

Cumulative statistics are collected in shared memory. Every <productname>PostgreSQL</productname> process collects statistics locally, then updates the shared data at appropriate intervals. When a server, including a physical replica, shuts down cleanly, a permanent copy of the statistics data is stored in the <filename>pg_stat</filename> subdirectory, so that statistics can be retained across server restarts. In contrast, when starting from an unclean shutdown (e.g., after an immediate shutdown, a server crash, starting from a base backup, and point-in-time recovery), all statistics counters are reset. 累積統計情報は共有メモリに収集されます。 すべてのPostgreSQLプロセスがローカルで統計情報を収集し、適切な間隔で共有データを更新します。 物理レプリカを含むサーバがクリーンにシャットダウンすると、統計データの永続的なコピーがpg_statサブディレクトリに保存されます。 これにより、サーバの再起動後も統計情報を保持できます。 対照的に、クリーンでないシャットダウンから開始する場合(即時シャットダウン後、サーバクラッシュ、ベースバックアップから開始、ポイントインタイムリカバリなど)、すべての統計カウンタがリセットされます。

28.2.2. 統計情報の表示 #

<title>Viewing Statistics</title>

Several predefined views, listed in <xref linkend="monitoring-stats-dynamic-views-table"/>, are available to show the current state of the system. There are also several other views, listed in <xref linkend="monitoring-stats-views-table"/>, available to show the accumulated statistics. Alternatively, one can build custom views using the underlying cumulative statistics functions, as discussed in <xref linkend="monitoring-stats-functions"/>. システムの現在の状態を表示するために、いくつかの定義済みのビューがあり、表 28.1に一覧されています。 また、累積統計の収集結果を表示するために、他にもいくつかのビューがあり、表 28.2に一覧されています。 あるいはまた、28.2.25で説明する、基礎的な累積統計関数を使用した独自のビューを構築することもできます。

When using the cumulative statistics views and functions to monitor collected data, it is important to realize that the information does not update instantaneously. Each individual server process flushes out accumulated statistics to shared memory just before going idle, but not more frequently than once per <varname>PGSTAT_MIN_INTERVAL</varname> milliseconds (1 second unless altered while building the server); so a query or transaction still in progress does not affect the displayed totals and the displayed information lags behind actual activity. However, current-query information collected by <varname>track_activities</varname> is always up-to-date. 収集したデータを監視するために累積統計ビューや関数を使用する場合、この情報は即座に更新されないことを認識することが重要です。 個々のサーバプロセスは、待機状態になる直前に、累積統計を共有メモリにフラッシュしますが、PGSTAT_MIN_INTERVALミリ秒に1回以上の頻度でフラッシュすることはありません(サーバ構築時に変更しない限り1秒)。 したがって、まだ処理中の問い合わせやトランザクションは表示される合計に影響を与えず、表示される情報は実際のアクティビティより遅くなります。 しかし、track_activitiesで収集される現在の問い合わせの情報は常に最新です。

Another important point is that when a server process is asked to display any of the accumulated statistics, accessed values are cached until the end of its current transaction in the default configuration. So the statistics will show static information as long as you continue the current transaction. Similarly, information about the current queries of all sessions is collected when any such information is first requested within a transaction, and the same information will be displayed throughout the transaction. This is a feature, not a bug, because it allows you to perform several queries on the statistics and correlate the results without worrying that the numbers are changing underneath you. もう1つの重要なポイントは、サーバプロセスが累積された統計のいずれかを表示するように要求された場合、アクセスされた値はデフォルト構成で現在のトランザクションが終了するまでキャッシュされることです。 したがって、現在のトランザクションを続行しているかぎり、統計には静的な情報が表示されます。 同様に、すべてのセッションの現在の問合せに関する情報は、その情報がトランザクション内で最初に要求されたときに収集され、同じ情報がトランザクション全体にわたって表示されます。 これはバグではなく特徴です。 これにより、統計に対して複数の問合せを実行し、結果を相互に関連付ける際に、ユーザーの下で数値が変化することを心配する必要がないためです。 When analyzing statistics interactively, or with expensive queries, the time delta between accesses to individual statistics can lead to significant skew in the cached statistics. To minimize skew, <varname>stats_fetch_consistency</varname> can be set to <literal>snapshot</literal>, at the price of increased memory usage for caching not-needed statistics data. Conversely, if it's known that statistics are only accessed once, caching accessed statistics is unnecessary and can be avoided by setting <varname>stats_fetch_consistency</varname> to <literal>none</literal>. 統計情報を対話的に分析する場合、または高価な問い合わせを使用する場合、個々の統計へのアクセス間の時間差によって、キャッシュされた統計に大幅な歪みが発生する可能性があります。 歪みを最小化するには、stats_fetch_consistencysnapshotに設定します。 ただし、不要な統計データをキャッシュするためのメモリー使用量が増加します。逆に、統計が一度しかアクセスされないことがわかっている場合は、アクセスされた統計のキャッシュは不要であり、stats_fetch_consistencynoneに設定することで回避できます。 You can invoke <function>pg_stat_clear_snapshot</function>() to discard the current transaction's statistics snapshot or cached values (if any). The next use of statistical information will (when in snapshot mode) cause a new snapshot to be built or (when in cache mode) accessed statistics to be cached. pg_stat_clear_snapshot()を呼び出して、現在のトランザクションの統計スナップショットまたはキャッシュされた値(もしあれば)を破棄することができます。 次に統計情報を使用すると(スナップショットモードの場合)新しいスナップショットが作成され、(キャッシュモードの場合)アクセスされた統計がキャッシュされます。

A transaction can also see its own statistics (not yet flushed out to the shared memory statistics) in the views <structname>pg_stat_xact_all_tables</structname>, <structname>pg_stat_xact_sys_tables</structname>, <structname>pg_stat_xact_user_tables</structname>, and <structname>pg_stat_xact_user_functions</structname>. These numbers do not act as stated above; instead they update continuously throughout the transaction. トランザクションはまた、ビューのpg_stat_xact_all_tablespg_stat_xact_sys_tablespg_stat_xact_user_tables、およびpg_stat_xact_user_functionsを通じて、自身の統計情報(まだ共有メモリの統計情報にフラッシュされていない)も参照することができます。 これらの数値はトランザクション中に継続的に更新されていくため上記の様な(静的な情報を示す)振る舞いとはなりません。

Some of the information in the dynamic statistics views shown in <xref linkend="monitoring-stats-dynamic-views-table"/> is security restricted. Ordinary users can only see all the information about their own sessions (sessions belonging to a role that they are a member of). In rows about other sessions, many columns will be null. Note, however, that the existence of a session and its general properties such as its sessions user and database are visible to all users. Superusers and roles with privileges of built-in role <literal>pg_read_all_stats</literal> (see also <xref linkend="predefined-roles"/>) can see all the information about all sessions. 表 28.1で表示される動的な統計ビューの情報の中にはセキュリティ制限があるものがあります。 一般ユーザは自身のセッション(メンバとなっているロールに属するセッション)に関する全情報だけを参照できます。 他セッションに関する行では多くの列がNULLになるでしょう。 しかしながら、セッションの存在とセッションのユーザとデータベースなどの一般的な属性は全ユーザに可視であることに注意してください。 スーパーユーザと組み込みロールpg_read_all_statsの権限を持つロール(22.5も参照してください)は全セッションに関する全情報を参照できます。

表28.1 動的統計情報ビュー

<title>Dynamic Statistics Views</title>
ビュー名説明
pg_stat_activity One row per server process, showing information related to the current activity of that process, such as state and current query. See <link linkend="monitoring-pg-stat-activity-view"> <structname>pg_stat_activity</structname></link> for details. サーバプロセスあたり1行の形式で、状態や現在の問い合わせ等のプロセスの現在の活動状況に関連した情報を表示します。 詳細についてはpg_stat_activityを参照してください。
pg_stat_replication WAL送信プロセス毎に1行の形式で、送信サーバが接続したスタンバイサーバへのレプリケーションに関する統計情報を表示します。 詳細についてはpg_stat_replicationを参照してください。
pg_stat_wal_receiver 1行の形式で、受信サーバが接続したサーバからWAL受信サーバに関する統計情報を表示します。 詳細についてはpg_stat_wal_receiverを参照してください。
pg_stat_recovery_prefetch 1行の形式で、リカバリ中にプリフェッチされたブロックに関する統計情報を表示します。 詳細についてはpg_stat_recovery_prefetch を参照してください。
pg_stat_subscription 1つのサブスクリプションにつき少なくとも1行の形式で、サブスクリプションワーカーに関する情報を表示します。 詳細についてはpg_stat_subscriptionを参照してください。
pg_stat_ssl 接続(通常およびレプリケーション)あたり1行の形式で、接続に使われるSSLの情報を表示します。 詳細についてはpg_stat_sslを参照してください。
pg_stat_gssapi 接続(通常およびレプリケーション)あたり1行の形式で、接続に使われるGSSAPI認証と暗号化に関する情報を表示します。 詳細についてはpg_stat_gssapiを参照してください。
pg_stat_progress_analyze 《マッチ度[]》ANALYZEを実行している(自動バキュームワーカープロセスを含んだ)各バックエンドごとに1行の形式で、現在の進捗を表示します。 28.4.1を参照してください。
pg_stat_progress_create_index 《マッチ度[]》CREATE INDEXまたはREINDEXを実行している各バックエンドごとに1行の形式で、現在の進捗を表示します。 28.4.4を参照してください。
pg_stat_progress_vacuum 《マッチ度[]》VACUUMを実行している(自動バキュームワーカープロセスを含んだ)各バックエンドごとに1行の形式で、現在の進捗を表示します。 28.4.5を参照してください。
pg_stat_progress_cluster 《マッチ度[]》CLUSTERまたはVACUUM FULLを実行している各バックエンドごとに1行の形式で、現在の進捗を表示します。 28.4.2を参照してください。
pg_stat_progress_basebackup 《マッチ度[]》ベースバックアップをストリームしている各WAL送信プロセスごとに1行の形式で、現在の進捗を表示します。 28.4.6を参照してください。
pg_stat_progress_copy 《マッチ度[]》COPYを実行している各バックエンドごとに1行の形式で、現在の進捗を表示します。 28.4.3を参照してください。

表28.2 収集済み統計情報ビュー

<title>Collected Statistics Views</title>
ビュー名説明
pg_stat_archiver WALアーカイバプロセスの活動状況に関する統計情報を1行のみで表示します。 詳細についてはpg_stat_archiverを参照してください。
pg_stat_bgwriter バックグラウンドライタプロセスの活動状況に関する統計情報を1行のみで表示します。 詳細についてはpg_stat_bgwriterを参照してください。
pg_stat_database データベース毎に1行の形式で、データベース全体の統計情報を表示します。 詳細についてはpg_stat_databaseを参照してください。
pg_stat_database_conflicts One row per database, showing database-wide statistics about query cancels due to conflict with recovery on standby servers. See <link linkend="monitoring-pg-stat-database-conflicts-view"> <structname>pg_stat_database_conflicts</structname></link> for details. データベース毎に1行の形式で、スタンバイサーバにおける復旧との競合のためにキャンセルされた問い合わせについてのデータベース全体の統計情報を表示します。 詳細についてはpg_stat_database_conflictsを参照してください。
pg_stat_io One row for each combination of backend type, context, and target object containing cluster-wide I/O statistics. See pg_stat_io for details.
pg_stat_replication_slots レプリケーションスロットごとに1行の形式で、レプリケーションスロットの使用状況に関する統計情報を表示します。 詳細については pg_stat_replication_slotsを参照してください。
pg_stat_slru SLRUごとに1行の形で、操作に関する統計情報を示します。 詳細についてはpg_stat_slruを参照してください。
pg_stat_subscription_stats サブスクリプションごとに1行の形式で、エラーに関する統計を表示します。 詳細についてはpg_stat_subscription_statsを参照してください。
pg_stat_wal WALの活動状況に関する統計情報を1行のみで表示します。 詳細についてはpg_stat_walを参照してください。
pg_stat_all_tables One row for each table in the current database, showing statistics about accesses to that specific table. See <link linkend="monitoring-pg-stat-all-tables-view"> <structname>pg_stat_all_tables</structname></link> for details. 現在のデータベースの各テーブルごとに1行の形式で、特定のテーブルへのアクセスに関する統計情報を示します。 詳細についてはpg_stat_all_tablesを参照してください。
pg_stat_sys_tables システムテーブルのみが表示される点を除き、pg_stat_all_tablesと同じです。
pg_stat_user_tables ユーザテーブルのみが表示される点を除き、pg_stat_all_tablesと同じです。
pg_stat_xact_all_tables pg_stat_all_tablesと似ていますが、現在のトランザクションにて実施された処理結果をカウントします。(数値が見える時点では、これらの数値はpg_stat_all_tablesと関連するビューに含まれていません。) このビューでは、有効な行数、無効な行数、およびバキュームやアナライズの活動は表示しません。
pg_stat_xact_sys_tables システムテーブルのみが表示される点を除き、pg_stat_xact_all_tablesと同じです。
pg_stat_xact_user_tables ユーザテーブルのみが表示される点を除き、pg_stat_xact_all_tablesと同じです。
pg_stat_all_indexes One row for each index in the current database, showing statistics about accesses to that specific index. See <link linkend="monitoring-pg-stat-all-indexes-view"> <structname>pg_stat_all_indexes</structname></link> for details. 現在のデータベースのインデックスごとに1行の形式で、特定のインデックスへのアクセスに関する統計情報を示します。 詳細についてはpg_stat_all_indexesを参照してください。
pg_stat_sys_indexes システムテーブルのインデックスのみが表示される点を除き、pg_stat_all_indexesと同じです。
pg_stat_user_indexes ユーザテーブルのインデックスのみが表示される点を除き、pg_stat_all_indexesと同じです。
pg_stat_user_functions One row for each tracked function, showing statistics about executions of that function. See <link linkend="monitoring-pg-stat-user-functions-view"> <structname>pg_stat_user_functions</structname></link> for details. 追跡された関数ごとに1行の形式で、関数の実行に関する統計情報を表示します。 詳細についてはpg_stat_user_functionsを参照してください。
pg_stat_xact_user_functions pg_stat_user_functionsと似ていますが、現在のトランザクション中に呼び出されたものだけをカウントします。 (数値が見える時点では、これらの数値はpg_stat_user_functionsに含まれていません。)
pg_statio_all_tables One row for each table in the current database, showing statistics about I/O on that specific table. See <link linkend="monitoring-pg-statio-all-tables-view"> <structname>pg_statio_all_tables</structname></link> for details. 現在のデータベース内のテーブルごとに1行の形式で、特定のテーブルに対するI/Oに関する統計情報を示します。 詳細についてはpg_statio_all_tablesを参照してください。
pg_statio_sys_tables システムテーブルのみが表示される点を除き、pg_statio_all_tablesと同じです。
pg_statio_user_tables ユーザテーブルのみが表示される点を除き、pg_statio_all_tablesと同じです。
pg_statio_all_indexes One row for each index in the current database, showing statistics about I/O on that specific index. See <link linkend="monitoring-pg-statio-all-indexes-view"> <structname>pg_statio_all_indexes</structname></link> for details. 現在のデータベース内のインデックスごとに1行の形式で、特定のインデックスに対するI/Oに関する統計情報を表示します。 詳細についてはpg_statio_all_indexesを参照してください。
pg_statio_sys_indexes システムテーブルのインデックスのみが表示される点を除き、pg_statio_all_indexes と同じです。
pg_statio_user_indexes ユーザテーブルのインデックスのみが表示される点を除き、pg_statio_all_indexesと同じです。
pg_statio_all_sequences One row for each sequence in the current database, showing statistics about I/O on that specific sequence. See <link linkend="monitoring-pg-statio-all-sequences-view"> <structname>pg_statio_all_sequences</structname></link> for details. 現在のデータベース内のシーケンスごとに1行の形式で、特定のシーケンスに対するI/Oに関する統計情報を表示します。 詳細についてはpg_statio_all_sequencesを参照してください。
pg_statio_sys_sequences システムシーケンスのみが表示される点を除き、pg_statio_all_sequencesと同じです (現時点では、システムシーケンスは定義されていませんので、このビューは常に空です)。
pg_statio_user_sequences ユーザシーケンスのみが表示される点を除き、pg_statio_all_sequencesと同じです。

The per-index statistics are particularly useful to determine which indexes are being used and how effective they are. インデックス単位の統計情報は、どのインデックスが使用され、どの程度効果があるのかを評価する際に、特に有用です。

The <structname>pg_stat_io</structname> and <structname>pg_statio_</structname> set of views are useful for determining the effectiveness of the buffer cache. They can be used to calculate a cache hit ratio. Note that while <productname>PostgreSQL</productname>'s I/O statistics capture most instances in which the kernel was invoked in order to perform I/O, they do not differentiate between data which had to be fetched from disk and that which already resided in the kernel page cache. Users are advised to use the <productname>PostgreSQL</productname> statistics views in combination with operating system utilities for a more complete picture of their database's I/O performance. 《マッチ度[]》pg_stat_ioビューは主に、バッファキャッシュの効率を評価する際に有用です。 実ディスク読み取りの数がバッファヒットの数よりもかなり少ないのであれば、そのキャッシュはカーネル呼び出しを行うことなく、ほとんどの読み取り要求を満足させています。 しかし、PostgreSQLバッファキャッシュに存在しないデータはカーネルのI/Oキャッシュにある可能性があり、そのため、物理的な読み取りを行うことなく取り出される可能性があるというPostgreSQLのディスクI/Oの取り扱いのため、これらの統計情報は、完全な論拠を提供しません。 PostgreSQLのI/O動作に関するより詳細な情報を入手したいのであれば、PostgreSQL統計情報ビューとカーネルのI/Oの取り扱いの監視を行うオペレーティングシステムユーティリティを組み合わせることを勧めます。 《機械翻訳》pg_stat_iopg_statio_ビューは、バッファキャッシュの有効性を判断するのに役立ちます。 これらはキャッシュヒット率を計算するのに使用できます。 PostgreSQLのI/O統計は、I/Oを実行するためにカーネルが呼び出されたほとんどのインスタンスを取得しますが、ディスクからフェッチされなければならなかったデータと、カーネルページキャッシュにすでに存在していたデータとを区別しません。 ユーザは、データベースのI/Oパフォーマンスのより完全な全体像を得るために、PostgreSQLの統計ビューをオペレーティングシステムのユーティリティと組み合わせて使用することをお勧めします。

28.2.3. pg_stat_activity #

The <structname>pg_stat_activity</structname> view will have one row per server process, showing information related to the current activity of that process. pg_stat_activityはサーバプロセス毎に、そのプロセスの現在の活動に関連する情報を表示する1行を持ちます。

表28.3 pg_stat_activityビュー

<title><structname>pg_stat_activity</structname> View</title>

Column Type 列 型

Description 説明

datid oid

OID of the database this backend is connected to バックエンドが接続するデータベースのOIDです。

datname name

Name of the database this backend is connected to バックエンドが接続するデータベースの名前です。

pid integer

Process ID of this backend バックエンドのプロセスIDです。

leader_pid integer

Process ID of the parallel group leader if this process is a parallel query worker, or process ID of the leader apply worker if this process is a parallel apply worker. <literal>NULL</literal> indicates that this process is a parallel group leader or leader apply worker, or does not participate in any parallel operation. 《マッチ度[]》このプロセスがパラレルクエリワーカーであればパラレルグループリーダーのプロセスIDです。 このプロセスがパラレルグループリーダーであるか、パラレルクエリに参加していないのであればNULLです。 《機械翻訳》このプロセスがパラレル・グループ・リーダーである場合は、パラレル・グループ・リーダーのプロセスID。このプロセスがパラレル適用ワーカーである場合は、パラレル適用ワーカーのプロセスID。 NULLは、このプロセスがパラレル・グループ・リーダーまたはリーダー適用ワーカーであること、またはこのプロセスがパラレル適用ワーカーであることを示します。

usesysid oid

OID of the user logged into this backend バックエンドにログインしたユーザのOIDです。

usename name

Name of the user logged into this backend バックエンドにログインしたユーザの名前です。

application_name text

Name of the application that is connected to this backend バックエンドに接続したアプリケーションの名前です。

client_addr inet

IP address of the client connected to this backend. If this field is null, it indicates either that the client is connected via a Unix socket on the server machine or that this is an internal process such as autovacuum. バックエンドに接続したクライアントのIPアドレスです。 このフィールドがNULLである場合、これはクライアントがサーバマシン上のUnixソケット経由で接続されたか、自動バキュームなど内部プロセスであることを示しています。

client_hostname text

Host name of the connected client, as reported by a reverse DNS lookup of <structfield>client_addr</structfield>. This field will only be non-null for IP connections, and only when <xref linkend="guc-log-hostname"/> is enabled. client_addrのDNS逆引き検索により報告された、接続クライアントのホスト名です。 IP接続、かつlog_hostnameが有効である場合にのみこのフィールドは非NULLになります。

client_port integer

TCP port number that the client is using for communication with this backend, or <literal>-1</literal> if a Unix socket is used. If this field is null, it indicates that this is an internal server process. クライアントがバックエンドとの通信に使用するTCPポート番号、もしくはUnixソケットを使用する場合は-1です。 このフィールドがNULLであれば、内部のサーバプロセスであることを示しています。

backend_start timestamp with time zone

Time when this process was started. For client backends, this is the time the client connected to the server. プロセスが開始した時刻です。 クライアントのバックエンドについては、クライアントがサーバに接続した時刻です。

xact_start timestamp with time zone

Time when this process' current transaction was started, or null if no transaction is active. If the current query is the first of its transaction, this column is equal to the <structfield>query_start</structfield> column. プロセスの現在のトランザクションが開始した時刻です。活動中のトランザクションがない場合はNULLです。 現在の問い合わせがトランザクションの先頭である場合、この列はquery_start列と同じです。

query_start timestamp with time zone

Time when the currently active query was started, or if <structfield>state</structfield> is not <literal>active</literal>, when the last query was started 現在活動中の問い合わせが開始した時刻です。もしstateactiveでない場合は直前の問い合わせが開始した時刻です。

state_change timestamp with time zone

Time when the <structfield>state</structfield> was last changed stateの最終変更時刻です。

wait_event_type text

The type of event for which the backend is waiting, if any; otherwise NULL. See <xref linkend="wait-event-table"/>. バックエンドが待機しているイベントがあれば、その型、なければNULLとなります。 表 28.4を参照してください。

wait_event text

Wait event name if backend is currently waiting, otherwise NULL. See <xref linkend="wait-event-activity-table"/> through <xref linkend="wait-event-timeout-table"/>. バックエンドが現在待機している場合は待機イベント名、そうでなければNULLとなります。 表 28.5から表 28.13までを参照してください。

state text

Current overall state of this backend. Possible values are: 現在のバックエンドの総体的な状態です。 以下のいずれかの値を取ることができます。

  • <literal>active</literal>: The backend is executing a query. active: バックエンドは問い合わせを実行中です。

  • <literal>idle</literal>: The backend is waiting for a new client command. idle: バックエンドは新しいクライアントからのコマンドを待機しています。

  • <literal>idle in transaction</literal>: The backend is in a transaction, but is not currently executing a query. idle in transaction: バックエンドはトランザクションの内部にいますが、現在実行中の問い合わせがありません。

  • <literal>idle in transaction (aborted)</literal>: This state is similar to <literal>idle in transaction</literal>, except one of the statements in the transaction caused an error. idle in transaction (aborted): この状態はidle in transactionと似ていますが、トランザクション内のある文がエラーになっている点が異なります。

  • <literal>fastpath function call</literal>: The backend is executing a fast-path function. fastpath function call: バックエンドは近道関数を実行中です。

  • <literal>disabled</literal>: This state is reported if <xref linkend="guc-track-activities"/> is disabled in this backend. disabled: この状態は、このバックエンドでtrack_activitiesが無効である場合に報告されます。

backend_xid xid

Top-level transaction identifier of this backend, if any; see <xref linkend="transaction-id"/>. 《マッチ度[]》もしあれば、このバックエンドの最上位のトランザクション識別子です。 《機械翻訳》このバックエンドのトップレベルのトランザクション識別子(ある場合)。 74.1を参照してください。

backend_xmin xid

The current backend's <literal>xmin</literal> horizon. 現在のバックエンドのxminです。

query_id bigint

Identifier of this backend's most recent query. If <structfield>state</structfield> is <literal>active</literal> this field shows the identifier of the currently executing query. In all other states, it shows the identifier of last query that was executed. Query identifiers are not computed by default so this field will be null unless <xref linkend="guc-compute-query-id"/> parameter is enabled or a third-party module that computes query identifiers is configured. バックエンドの直近の問い合わせ識別子です。 stateactiveの場合、このフィールドには現在実行中の問い合わせ識別子が表示されます。 他のすべての状態では、最後に実行された問い合わせ識別子が表示されます。 問い合わせ識別子はデフォルトでは計算されないため、compute_query_idパラメータが有効になっているか、問い合わせ識別子を計算するサードパーティモジュールが設定されていない限り、このフィールドはnullになります。

query text

Text of this backend's most recent query. If <structfield>state</structfield> is <literal>active</literal> this field shows the currently executing query. In all other states, it shows the last query that was executed. By default the query text is truncated at 1024 bytes; this value can be changed via the parameter <xref linkend="guc-track-activity-query-size"/>. バックエンドの最も最近の問い合わせテキストです。 stateactiveの場合、このフィールドは現在実行中の問い合わせを示します。 その他のすべての状態では、実行済みの最後の問い合わせを示します。 デフォルトでは問い合わせのテキストは1024バイトで切り詰められますが、この値はパラメータtrack_activity_query_sizeにより変更できます。

backend_type text

Type of current backend. Possible types are <literal>autovacuum launcher</literal>, <literal>autovacuum worker</literal>, <literal>logical replication launcher</literal>, <literal>logical replication worker</literal>, <literal>parallel worker</literal>, <literal>background writer</literal>, <literal>client backend</literal>, <literal>checkpointer</literal>, <literal>archiver</literal>, <literal>standalone backend</literal>, <literal>startup</literal>, <literal>walreceiver</literal>, <literal>walsender</literal> and <literal>walwriter</literal>. In addition, background workers registered by extensions may have additional types. 《マッチ度[82.965300]》現在のバックエンドの種別です。 取り得る値はautovacuum launcherautovacuum workerlogical replication launcherlogical replication workerparallel worker, background writerclient backendcheckpointerarchiverstartupwalreceiverwalsenderwalwriterです。 これに加えて、拡張によって登録されたバックグラウンドワーカーは追加の型を持つかも知れません。 《機械翻訳》現在のバックエンドのタイプ。 可能なタイプは、autovacuum launcherautovacuum workerlogical replication launcherlogical replication workerparallel workerbackground writerclient backendcheckpointerarchiverstandalone backendstartupwalreceiverwalsenderおよびwalwriterです。 さらに、拡張によって登録されたバックグラウンドワーカーは追加のタイプを持つことができます。


注記

The <structfield>wait_event</structfield> and <structfield>state</structfield> columns are independent. If a backend is in the <literal>active</literal> state, it may or may not be <literal>waiting</literal> on some event. If the state is <literal>active</literal> and <structfield>wait_event</structfield> is non-null, it means that a query is being executed, but is being blocked somewhere in the system. wait_eventstate列は独立しています。 バックエンドがactive状態である場合、いくつかのイベントではwaitingかもしれませんし、そうでないかもしれません。 状態がactiveであり、wait_eventがNULLでない場合、問い合わせは実行中ですが、システム内のどこかでブロックされていることを意味します。

表28.4 待機イベント型

<title>Wait Event Types</title>
待機イベント型説明
Activity サーバプロセスはアイドル状態です。 このイベント型はプロセスがメインの処理ループ内で活動を待機していることを示します。 wait_eventによりその待機点が特定できます。 表 28.5を参照してください。
BufferPin サーバプロセスは、データバッファに排他的アクセスをするために待機しています。 バッファピン待機は、他のプロセスが該当のバッファから最後に読み込んだデータのオープンカーソルを保持している場合に長引かされることがあります。 表 28.6を参照してください。
Client サーバプロセスはユーザアプリケーションに接続しているソケット上での活動を待機しています。 それゆえ、サーバはその内部プロセスとは無関係の何かが起きることを期待しています。 wait_eventによりその待機点が特定できます。表 28.7を参照してください。
Extension サーバプロセスは拡張モジュールにより定義された条件を待機しています。 表 28.8を参照してください。
IO サーバプロセスは入出力が完了するのを待機しています。 wait_eventによりその待機点が特定できます。表 28.9を参照してください。
IPC サーバプロセスは、他のサーバプロセスとの相互作用を待機しています。 wait_eventによりその待機点が特定できます。表 28.10を参照してください。
Lock サーバプロセスは重量ロックを待機しています。 ロックマネージャロックや単にロックとしても知られている重量ロックは、主にテーブルのようなSQLで可視なオブジェクトを保護します。 しかし、それらはリレーション拡張のような、なんらかの内部操作のために相互排他を確実にするためにも使用されます。 wait_eventは、待たせているロックの型を識別します。 表 28.11を参照してください。
LWLock サーバプロセスは軽量ロックを待機しています。 ほとんどのこのようなロックは、共有メモリ内の特定のデータ構造を保護します。 wait_eventには軽量ロックの目的を特定する名前が入ります。 (特定の名前がついたロックもあれば、似たような目的のロックのグループの一部となっているものもあります。) 表 28.12を参照してください。
Timeout サーバプロセスはタイムアウトが満了するのを待機しています。 wait_eventによりその待機点が特定できます。表 28.13を参照してください。

表28.5 Activity型の待機イベント

<title>Wait Events of Type <literal>Activity</literal></title>
Activity待機イベント説明
ArchiverMainアーカイバプロセスのメインループ内で待機しています。
AutoVacuumMain自動バキュームのランチャプロセスのメインループ内で待機しています。
BgWriterHibernateバックグラウンドライタプロセス内で待機し、休止状態になっています。
BgWriterMainバックグラウンドライタプロセスのメインループ内で待機しています。
CheckpointerMainチェックポインタプロセスのメインループ内で待機しています。
LogicalApplyMain論理レプリケーション適用プロセスのメインループ内で待機しています。
LogicalLauncherMain論理レプリケーションランチャプロセスのメインループ内で待機しています。
LogicalParallelApplyMainWaiting in main loop of logical replication parallel apply process.
RecoveryWalStreamストリーミングリカバリ中に、起動プロセスのメインループ内でWALが到着するのを待機しています。
SysLoggerMainsysloggerプロセスのメインループ内で待機しています。
WalReceiverMainWAL受信プロセスのメインループ内で待機しています。
WalSenderMainWAL送信プロセスのメインループ内で待機しています。
WalWriterMainWAL書き込みプロセスのメインループ内で待機しています。

表28.6 BufferPin型の待機イベント

<title>Wait Events of Type <literal>BufferPin</literal></title>
BufferPin待機イベント説明
BufferPinバッファ上の排他ピンを獲得するのを待機しています。

表28.7 Client型の待機イベント

<title>Wait Events of Type <literal>Client</literal></title>
Client待機イベント説明
ClientReadクライアントからのデータの読み込みを待機しています。
ClientWriteクライアントへのデータの書き込みを待機しています。
GSSOpenServerGSSAPIセッションを確立する際にクライアントからのデータ読み込みを待機しています。
LibPQWalReceiverConnectWAL受信プロセス内でリモートサーバへの接続が確立するのを待機しています。
LibPQWalReceiverReceiveWAL受信プロセス内でリモートサーバからデータを受信するのを待機しています。
SSLOpenServer接続試行中にSSLを待機しています。
WalSenderWaitForWALWAL送信プロセス内でWALがフラッシュされるのを待機しています。
WalSenderWriteDataWAL送信プロセス内でWAL受信者からの応答を処理している時に、何らかの活動を待機しています。

表28.8 Extension型の待機イベント

<title>Wait Events of Type <literal>Extension</literal></title>
Extension待機イベント説明
Extension拡張内で待機しています。

表28.9 IO型の待機イベント

<title>Wait Events of Type <literal>IO</literal></title>
IO待機イベント説明
BaseBackupReadベースバックアップがファイルから読み取るのを待機しています。
BaseBackupSyncベースバックアップによって書き込まれたデータが永続的ストレージに到達するのを待機しています。
BaseBackupWriteベースバックアップがファイルに書き込むのを待機しています。
BufFileReadバッファファイルからの読み取りを待機しています。
BufFileTruncateバッファファイルが切り捨てられるのを待機しています。
BufFileWriteバッファファイルへの書き込みを待機しています。
ControlFileReadpg_controlファイルからの読み取りを待機しています。
ControlFileSyncpg_controlファイルが永続的ストレージに到達するのを待機しています。
ControlFileSyncUpdatepg_controlファイルの更新が永続的ストレージに到達するのを待機しています。
ControlFileWritepg_controlファイルへの書き込みを待機しています。
ControlFileWriteUpdatepg_controlファイルの更新の書き込みを待機しています。
CopyFileReadファイルコピーの操作の間、読み込みを待機しています。
CopyFileWriteファイルコピーの操作の間、書き込みを待機しています。
DSMAllocateWaiting for a dynamic shared memory segment to be allocated.
DSMFillZeroWrite動的共有メモリの背後のファイルにゼロのバイトを書き込むのを待機しています。
DataFileExtendリレーションのデータファイルが拡張されるのを待機しています。
DataFileFlushリレーションのデータファイルが永続的ストレージに到達するのを待機しています。
DataFileImmediateSyncリレーションのデータファイルが永続的ストレージに即座に同期されるのを待機しています。
DataFilePrefetchリレーションのデータファイルからの非同期プリフェッチを待機しています。
DataFileReadリレーションのデータファイルからの読み込みを待機しています。
DataFileSyncリレーションのデータファイルへの変更が永続的ストレージに到達するのを待機しています。
DataFileTruncateリレーションのデータファイルが切り詰められるのを待機しています。
DataFileWriteリレーションのデータファイルへの書き込みを待機しています。
LockFileAddToDataDirReadデータディレクトリのロックファイルに行を追加する間の読み込みを待機しています。
LockFileAddToDataDirSyncデータディレクトリのロックファイルに行を追加する間、データが永続的ストレージに到達するのを待機しています。
LockFileAddToDataDirWriteデータディレクトリのロックファイルに行を追加する間の書き込みを待機しています。
LockFileCreateReadデータディレクトリのロックファイルを作成する間の読み込みを待機しています。
LockFileCreateSyncデータディレクトリのロックファイルを作成する間、データが永続的ストレージに到達するのを待機しています。
LockFileCreateWriteデータディレクトリのロックファイルを作成する間の書き込みを待機しています。
LockFileReCheckDataDirReadデータディレクトリのロックファイルを再検査する間の読み込みを待機しています。
LogicalRewriteCheckpointSyncチェックポイントの間に、論理的な再書き込みのマッピングが永続的ストレージに到達するのを待機しています。
LogicalRewriteMappingSync論理的な再書き込みの間に、マッピングデータが永続的ストレージに到達するのを待機しています。
LogicalRewriteMappingWrite論理的な再書き込みの間に、マッピングデータの書き込みを待機しています。
LogicalRewriteSync論理的な再書き込みのマッピングが永続的ストレージに到達するのを待機しています。
LogicalRewriteTruncate論理的な再書き込みの際にマッピングデータが切り詰められるのを待機しています。
LogicalRewriteWrite論理的な再書き込みのマッピングの書き込みを待機しています。
RelationMapReadリレーションのマップファイルの読み込みを待機しています。
RelationMapReplaceWaiting for durable replacement of a relation map file.
RelationMapWriteリレーションのマップファイルの書き込みを待機しています。
ReorderBufferRead並べ替えのバッファ管理の間に読み込みを待機しています。
ReorderBufferWrite並べ替えのバッファ管理の間に書き込みを待機しています。
ReorderLogicalMappingRead並べ替えのバッファ管理の間に、論理マッピングの読み込みを待機しています。
ReplicationSlotReadレプリケーションスロットの制御ファイルからの読み込みを待機しています。
ReplicationSlotRestoreSyncレプリケーションスロットの制御ファイルをメモリにリストアする間、それが永続的ストレージに到達するのを待機しています。
ReplicationSlotSyncレプリケーションスロットの制御ファイルが永続的ストレージに到達するのを待機しています。
ReplicationSlotWriteレプリケーションスロットの制御ファイルへの書き込みを待機しています。
SLRUFlushSyncチェックポイントまたはデータベースのシャットダウン中に、SLRUデータが永続的ストレージに到達するのを待機しています。
SLRUReadSLRUページの読み込みを待機しています。
SLRUSyncページ書き込みの後、SLRUデータが永続的ストレージに到達するのを待機しています。
SLRUWriteSLRUページの書き込みを待機しています。
SnapbuildReadシリアライズされた通時的カタログのスナップショットの読み込みを待機しています。
SnapbuildSyncシリアライズされた通時的カタログのスナップショットが永続的ストレージに到達するのを待機しています。
SnapbuildWriteシリアライズされた通時的カタログのスナップショットの書き込みを待機しています。
TimelineHistoryFileSyncストリーミングレプリケーションを経由して受け取ったタイムラインの履歴ファイルが永続的ストレージに到達するのを待機しています。
TimelineHistoryFileWriteストリーミングレプリケーションを経由して受け取ったタイムラインの履歴ファイルの書き込みを待機しています。
TimelineHistoryReadタイムラインの履歴ファイルの読み込みを待機しています。
TimelineHistorySync新しく作成されたタイムラインの履歴ファイルが永続的ストレージに到達するのを待機しています。
TimelineHistoryWrite新しく作成されたタイムラインの履歴ファイルの書き込みを待機しています。
TwophaseFileRead二相の状態ファイルの読み込みを待機しています。
TwophaseFileSync二相の状態ファイルが永続的ストレージに到達するのを待機しています。
TwophaseFileWrite二相の状態ファイルの書き込みを待機しています。
VersionFileWriteデータベースの作成中にバージョンファイルが作成されるのを待機しています。
WALBootstrapSyncブートストラップ時にWALが永続的ストレージに到達するのを待機しています。
WALBootstrapWriteブートストラップ時にWALページの書き込みを待機しています。
WALCopyRead既存のWALセグメントをコピーして新しいWALセグメントを作成する時に読み込みを待機しています。
WALCopySync既存のWALセグメントをコピーして作成した新しいWALセグメントが永続的ストレージに到達するのを待機しています。
WALCopyWrite既存のWALセグメントをコピーして新しいWALセグメントを作成する時に書き込みを待機しています。
WALInitSync新しく初期化されたWALファイルが永続的ストレージに到達するのを待機しています。
WALInitWrite新しいWALファイルを初期化している時に書き込みを待機しています。
WALReadWALファイルからの読み込みを待機しています。
WALSenderTimelineHistoryReadWAL送信サーバのタイムラインコマンドで、タイムラインの履歴ファイルの読み込みを待機しています。
WALSyncWALファイルが永続的ストレージに達するのを待機しています。
WALSyncMethodAssign新しいWALの同期方法を割り当てている時にデータが永続的ストレージに到達するのを待機しています。
WALWriteWALファイルへの書き込みを待機しています。

表28.10 IPC型の待機イベント

<title>Wait Events of Type <literal>IPC</literal></title>
IPC待機イベント説明
AppendReadyAppendプランノードのサブプランノードの準備が整うのを待機しています。
ArchiveCleanupCommandarchive_cleanup_commandが完了するのを待機しています。
ArchiveCommandarchive_commandが完了するのを待機しています。
BackendTermination他のバックエンドの終了を待機しています。
BackupWaitWalArchiveバックアップに必要なWALファイルがアーカイブに成功するのを待機しています。
BgWorkerShutdownバックグラウンドワーカーがシャットダウンするのを待機しています。
BgWorkerStartupバックグラウンドワーカーが起動するのを待機しています。
BtreePageパラレルB-treeスキャンを継続するのに必要なページ番号が利用可能になるのを待機しています。
BufferIOバッファI/Oが完了するのを待機しています。
CheckpointDoneチェックポイントが完了するのを待機しています。
CheckpointStartチェックポイントが開始するのを待機しています。
ExecuteGatherGather計画ノードの実行時に子プロセスの活動を待機しています。
HashBatchAllocate選ばれたパラレルハッシュ参加者がハッシュテーブルを獲得するのを待機しています。
HashBatchElectハッシュテーブルを獲得するパラレルハッシュ参加者を選ぶのを待機しています。
HashBatchLoad他のパラレルハッシュ参加者がハッシュテーブルのロードを完了させるのを待機しています。
HashBuildAllocate選ばれたパラレルハッシュ参加者が初期ハッシュテーブルを獲得するのを待機しています。
HashBuildElect初期ハッシュテーブルを獲得するパラレルハッシュ参加者を選ぶのを待機しています。
HashBuildHashInner他のパラレルハッシュ参加者がインナーリレーションのハッシュを完了させるのを待機しています。
HashBuildHashOuter他のパラレルハッシュ参加者がアウターリレーションのパーティショニングを完了させるのを待機しています。
HashGrowBatchesDecide将来のバッチの増加を決めるパラレルハッシュ参加者を選ぶのを待機しています。
HashGrowBatchesElect追加バッチを獲得するパラレルハッシュ参加者を選ぶのを待機しています。
HashGrowBatchesFinish選ばれたパラレルハッシュ参加者が将来のバッチの増加を決めるのを待機しています。
HashGrowBatchesReallocate選ばれたパラレルハッシュ参加者が追加バッチを獲得するのを待機しています。
HashGrowBatchesRepartition他のパラレルハッシュ参加者がリパーティショニングを完了させるのを待機しています。
HashGrowBucketsElect追加バケットを獲得するパラレルハッシュ参加者を選ぶのを待機しています。
HashGrowBucketsReallocate選ばれたパラレルハッシュ参加者が追加バケット獲得を完了するのを待機しています。
HashGrowBucketsReinsert他のパラレルハッシュ参加者が新しいバケットに対するタプル挿入を完了させるのを待機しています。
LogicalApplySendDataWaiting for a logical replication leader apply process to send data to a parallel apply process.
LogicalParallelApplyStateChangeWaiting for a logical replication parallel apply process to change state.
LogicalSyncData論理レプリケーションのリモートサーバが最初のテーブル同期のためのデータを送信するのを待機しています。
LogicalSyncStateChange論理レプリケーションのリモートサーバが状態を変更するのを待機しています。
MessageQueueInternal他のプロセスが共有メッセージキューにアタッチされるのを待機しています。
MessageQueuePutMessage共有メッセージキューにプロトコルのメッセージを書くのを待機しています。
MessageQueueReceive共有メッセージキューからバイトを受信するのを待機しています。
MessageQueueSend共有メッセージキューにバイトを送信するのを待機しています。
ParallelBitmapScanパラレルビットマップスキャンが初期化されるのを待機しています。
ParallelCreateIndexScanパラレルCREATE INDEXワーカーがヒープスキャンを完了するのを待機しています。
ParallelFinishパラレルワーカーが計算を完了するのを待機しています。
ProcArrayGroupUpdateグループリーダーが並列操作の最後にトランザクションIDをクリアするのを待機しています。
ProcSignalBarrierバックエンドすべてでバリアイベントが処理されるのを待機しています。
Promoteスタンバイの昇格を待機しています。
RecoveryConflictSnapshotバキュームクリーンアップに対するリカバリ競合の解決を待機しています。
RecoveryConflictTablespaceテーブル空間の削除に対するリカバリ競合の解決を待機しています。
RecoveryEndCommandrecovery_end_commandが完了するのを待機しています。
RecoveryPauseリカバリが再開するのを待機しています。
ReplicationOriginDropレプリケーションオリジンが削除できるよう非活動状態になるのを待機しています。
ReplicationSlotDropレプリケーションスロットが削除できるよう非活動状態になるのを待機しています。
RestoreCommandWaiting for restore_commandが完了するのを待機しています。
SafeSnapshotREAD ONLY DEFERRABLEのトランザクションに対する有効なスナップショットの獲得を待機しています。
SyncRep同期レプリケーション中に、リモートサーバからの確認を待機しています。
WalReceiverExitWALレシーバが終了するのを待機しています。
WalReceiverWaitStartストリーミングレプリケーションの初期データを送信するための起動プロセスを待機しています。
XactGroupUpdateグループリーダーが並列操作の最後にトランザクション状態を更新するのを待機しています。

表28.11 Lock型の待機イベント

<title>Wait Events of Type <literal>Lock</literal></title>
Lock待機イベント説明
advisory勧告的ユーザロックを獲得するのを待機しています。
applytransactionWaiting to acquire a lock on a remote transaction being applied by a logical replication subscriber.
extendリレーションを拡張するのを待機しています。
frozenidpg_database.datfrozenxidpg_database.datminmxidを更新するのを待機しています。
object非リレーションデータベースオブジェクト上のロックを獲得するのを待機しています。
pageリレーションのページ上のロックを獲得するのを待機しています。
relationリレーション上のロックを獲得するのを待機しています。
spectoken投機的挿入ロックを獲得するのを待機しています。
transactionidトランザクションが終了するのを待機しています。
tupleタプル上のロックを獲得するのを待機しています。
userlockユーザロックを獲得するのを待機しています。
virtualxidWaiting to acquire a virtual transaction ID lock; see 74.1.

表28.12 LWLock型の待機イベント

<title>Wait Events of Type <literal>LWLock</literal></title>
LWLock待機イベント説明
AddinShmemInit共有メモリの拡張の領域確保を管理するのを待機しています。
AutoFilepostgresql.auto.confファイルを更新するのを待機しています。
Autovacuum自動バキュームワーカーの現在の状態の読み込み、または更新を待機しています。
AutovacuumSchedule自動バキューム対象として選定されたテーブルが、まだバキューム処理が必要であることを確認するのを待機しています。
BackgroundWorkerバックグラウンドワーカー状態の読み込み、または更新を待機しています。
BtreeVacuumB-treeインデックスのバキュームに関連した情報の読み込み、または更新を待機しています。
BufferContentメモリ内のデータページへアクセスするのを待機しています。
BufferMappingデータブロックをバッファプール内のバッファと関連付けるのを待機しています。
CheckpointerCommfsyncリクエストを管理するのを待機しています。
CommitTsトランザクションコミットタイムスタンプのために設定された最新の値の読み込み、または更新を待機しています。
CommitTsBufferコミットタイムスタンプSLRUバッファでのI/Oを待機しています。
CommitTsSLRUコミットタイムスタンプSLRUキャッシュにアクセスするのを待機しています。
ControlFilepg_controlファイルの読み込みもしくは更新、または新しいWALファイルの作成を待機しています。
DynamicSharedMemoryControl動的共有メモリの割り当て情報の読み込み、または更新を待機しています。
LockFastPathプロセスのファストパスロック情報の読み込み、または更新を待機しています。
LockManager重量ロックに関する情報の読み込み、または更新を待機しています。
LogicalRepLauncherDSAWaiting to access logical replication launcher's dynamic shared memory allocator.
LogicalRepLauncherHashWaiting to access logical replication launcher's shared hash table.
LogicalRepWorker論理レプリケーションワーカーの状態の読み込み、または更新を待機しています。
MultiXactGen共有マルチトランザクション状態の読み込み、または更新を待機しています。
MultiXactMemberBufferマルチトランザクションメンバSLRUバッファでのI/Oを待機しています。
MultiXactMemberSLRUマルチトランザクションメンバSLRUキャッシュにアクセスするのを待機しています。
MultiXactOffsetBufferマルチトランザクションオフセットSLRUバッファでのI/Oを待機しています。
MultiXactOffsetSLRUマルチトランザクションオフセットSLRUキャッシュにアクセスするのを待機しています。
MultiXactTruncationマルチトランザクション情報の読み込み、または切り詰めを待機しています。
NotifyBufferNOTIFYメッセージSLRUバッファでのI/Oを待機しています。
NotifyQueueNOTIFYメッセージの読み込み、または更新を待機しています。
NotifyQueueTailNOTIFYメッセージストレージの制限が更新されるのを待機しています。
NotifySLRUNOTIFYメッセージSLRUキャッシュにアクセスするのを待機しています。
OidGen新しいOIDを割り当てるのを待機しています。
OldSnapshotTimeMap古いスナップショット制御情報の読み込み、または更新を待機しています。
ParallelAppendパラレルアペンド計画を実行中に次のサブプランの選択を待機しています。
ParallelHashJoinパラレルハッシュ結合計画を実行中に、ワーカーの同期を待機しています。
ParallelQueryDSAパラレルクエリの動的共有メモリ割り当てを待機しています。
PerSessionDSAパラレルクエリの動的共有メモリ割り当てを待機しています。
PerSessionRecordType複合型に関するパラレルクエリの情報にアクセスするのを待機しています。
PerSessionRecordTypmod匿名レコード型を特定する型修飾子に関するパラレルクエリの情報にアクセスするのを待機しています。
PerXactPredicateListパラレルクエリの間に、現在のシリアライザブルトランザクションによって保持された述語ロックの一覧へアクセスするのを待機しています。
PgStatsData共有メモリの統計データアクセスを待機しています。
PgStatsDSA統計動的共有メモリアロケータアクセスを待機しています。
PgStatsHash統計共有メモリハッシュテーブルアクセスを待機しています。
PredicateLockManagerシリアライザブルトランザクションによって使われる述語ロックの情報にアクセスするのを待機しています。
ProcArray(典型的には、スナップショットを得たりセッションのトランザクションIDを報告するために)共有のプロセスごとのデータ構造にアクセスするのを待機しています。
RelationMapping(特定のシステムカタログのファイルノードの割り当てを追跡するのに使われる)pg_filenode.mapファイルの読み込み、または更新を待機しています。
RelCacheInitpg_internal.initリレーションキャッシュ初期化ファイルの読み込み、または更新を待機しています。
ReplicationOriginレプリケーションオリジンの作成、削除、または使用を待機しています。
ReplicationOriginStateあるレプリケーションオリジンの進捗の読み込み、または更新を待機しています。
ReplicationSlotAllocationレプリケーションスロットの割り当て、または解放を待機しています。
ReplicationSlotControlレプリケーションスロット状態の読み込み、または更新を待機しています。
ReplicationSlotIOレプリケーションスロットでのI/Oを待機しています。
SerialBufferシリアライザブルトランザクション競合SLRUバッファでのI/Oを待機しています
SerializableFinishedList完了したシリアライザブルトランザクションの一覧へアクセスするのを待機しています。
SerializablePredicateListシリアライザブルトランザクションによって保持された述語ロックの一覧へアクセスするのを待機しています。
SerializableXactHashシリアライザブルトランザクションに関する情報の読み込み、または更新を待機しています。
SerialSLRUシリアライザブルトランザクション競合SLRUキャッシュにアクセスするのを待機しています。
SharedTidBitmapパラレルビットマップインデックススキャンの間に、共有TIDにアクセスするのを待機しています。
SharedTupleStoreパラレルクエリの間に共有タプルストアにアクセスするのを待機しています。
ShmemIndex共有メモリ内に領域を発見する、もしくは割り当てるのを待機しています。
SInvalRead共有カタログ無効化キューからメッセージを取り出すのを待機しています。
SInvalWrite共有カタログ無効化キューにメッセージを追加するのを待機しています。
SubtransBufferサブトランザクションSLRUバッファのI/Oを待機しています。
SubtransSLRUサブトランザクションSLRUキャッシュにアクセスするのを待機しています。
SyncRep同期レプリケーションの状態に関する情報を読み込む、または更新するの待機しています。
SyncScan同期テーブルスキャンの開始位置を選ぶのを待機しています。
TablespaceCreateテーブルスペースの作成、または削除を待機しています。
TwoPhaseStateプリペアドトランザクションの状態の読み込み、または更新を待機しています。
WALBufMappingWALバッファ内のページの置き換えを待機しています。
WALInsertWALデータをメモリバッファに挿入するのを待機しています。
WALWriteWALバッファがディスクに書き込まれるのを待機しています。
WrapLimitsVacuumトランザクションIDとマルチトランザクションの消費の制限が更新されるのを待機しています。
XactBufferトランザクション状態SLRUバッファでのI/Oを待機しています。
XactSLRUトランザクション状態SLRUキャッシュにアクセスするのを待機しています。
XactTruncationpg_xact_statusを実行する、またはその関数で利用可能な最古のトランザクションIDを更新するのを待機しています。
XidGen新しいトランザクションIDを割り当てるのを待機しています。

注記

Extensions can add <literal>LWLock</literal> types to the list shown in <xref linkend="wait-event-lwlock-table"/>. In some cases, the name assigned by an extension will not be available in all server processes; so an <literal>LWLock</literal> wait event might be reported as just <quote><literal>extension</literal></quote> rather than the extension-assigned name. 拡張は表 28.12に示す一覧にLWLock型を追加できます。 拡張によって割り当てられた名前がすべてのサーバプロセスでは利用可能でない場合があります。そのためLWLock待機イベントは、拡張が割り当てた名前ではなく単にextensionと報告されるかもしれません。

表28.13 Timeout型の待機イベント

<title>Wait Events of Type <literal>Timeout</literal></title>
Timeout待機イベント説明
BaseBackupThrottleスロットル活動時にベースバックアップで待機しています。
CheckpointWriteDelayチェックポイント実行中の書き込みの間で待機しています。
PgSleeppg_sleepまたは同系列の関数を呼び出したため待機しています。
RecoveryApplyDelay遅延設定によりリカバリ時のWAL適用を待機しています。
RecoveryRetrieveRetryIntervalWALデータがまだあらゆる種類のソース(pg_wal、アーカイブまたはストリーム)から得られない時にリカバリで待機しています。
RegisterSyncRequest要求キューがいっぱいのため、同期要求をチェックポインターに送信する間、待機しています。
SpinDelayWaiting while acquiring a contended spinlock.
VacuumDelayコストに基づくバキューム遅延ポイントで待機しています。
VacuumTruncateバキュームされたテーブルの最後にある空のロックをオフで切り捨てるために、排他的ページの獲得を待機しています。

Here is an example of how wait events can be viewed: 以下に、待機イベントが表示される例を示します。

SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event is NOT NULL;
 pid  | wait_event_type | wait_event
------+-----------------+------------
 2540 | Lock            | relation
 6644 | LWLock          | ProcArray
(2 rows)

28.2.4. pg_stat_replication #

The <structname>pg_stat_replication</structname> view will contain one row per WAL sender process, showing statistics about replication to that sender's connected standby server. Only directly connected standbys are listed; no information is available about downstream standby servers. pg_stat_replicationビューには、WAL送信プロセス毎に1行を含み、送信処理に接続したスタンバイサーバへのレプリケーションに関する統計情報を表示します。 直接接続されたスタンバイサーバのみが一覧表示されます。 下流のスタンバイサーバに関する情報はありません。

表28.14 pg_stat_replicationビュー

<title><structname>pg_stat_replication</structname> View</title>

Column Type 列 型

Description 説明

pid integer

Process ID of a WAL sender process WAL送信プロセスのプロセスIDです。

usesysid oid

OID of the user logged into this WAL sender process WAL送信プロセスにログインしたユーザのOIDです。

usename name

Name of the user logged into this WAL sender process WAL送信プロセスにログインしたユーザの名前です。

application_name text

Name of the application that is connected to this WAL sender WAL送信処理に接続したアプリケーションの名前です。

client_addr inet

IP address of the client connected to this WAL sender. If this field is null, it indicates that the client is connected via a Unix socket on the server machine. WAL送信処理に接続したクライアントのIPアドレスです。 このフィールドがNULLの場合、クライアントがサーバマシン上のUnixソケット経由で接続したことを示します。

client_hostname text

Host name of the connected client, as reported by a reverse DNS lookup of <structfield>client_addr</structfield>. This field will only be non-null for IP connections, and only when <xref linkend="guc-log-hostname"/> is enabled. client_addrのDNS逆引き検索により報告された、接続クライアントのホスト名です。 IP接続、かつlog_hostnameが有効である場合にのみ、このフィールドは非NULLになります。

client_port integer

TCP port number that the client is using for communication with this WAL sender, or <literal>-1</literal> if a Unix socket is used クライアントがWAL送信処理との通信に使用するTCPポート番号、もしUnixソケットを使用する場合は-1です。

backend_start timestamp with time zone

Time when this process was started, i.e., when the client connected to this WAL sender プロセスが開始、つまりクライアントがWAL送信処理に接続した時刻です。

backend_xmin xid

This standby's <literal>xmin</literal> horizon reported by <xref linkend="guc-hot-standby-feedback"/>. hot_standby_feedbackにより報告されたこのスタンバイのxminです。

state text

Current WAL sender state. Possible values are: WAL送信サーバの現在の状態です。 取り得る値は以下の通りです。

  • <literal>startup</literal>: This WAL sender is starting up. startup: このWAL送信サーバは起動するところです。

  • <literal>catchup</literal>: This WAL sender's connected standby is catching up with the primary. catchup: このWAL送信サーバが接続しているスタンバイはプライマリに追いつこうとしています。

  • <literal>streaming</literal>: This WAL sender is streaming changes after its connected standby server has caught up with the primary. streaming: このWAL送信サーバは、接続先のスタンバイサーバがプライマリに追いついた後、変更をストリームしています。

  • <literal>backup</literal>: This WAL sender is sending a backup. backup: このWAL送信サーバはバックアップを送信しています。

  • <literal>stopping</literal>: This WAL sender is stopping. stopping: このWAL送信サーバは停止するところです。

sent_lsn pg_lsn

Last write-ahead log location sent on this connection この接続で送信された最後の先行書き込みログの位置です。

write_lsn pg_lsn

Last write-ahead log location written to disk by this standby server このスタンバイサーバによってディスクに書き出された最後の先行書き込みログの位置です。

flush_lsn pg_lsn

Last write-ahead log location flushed to disk by this standby server このスタンバイサーバによってディスクにフラッシュされた最後の先行書き込みログの位置です。

replay_lsn pg_lsn

Last write-ahead log location replayed into the database on this standby server このスタンバイサーバ上のデータベースに再生された最後の先行書き込みログの位置です。

write_lag interval

Time elapsed between flushing recent WAL locally and receiving notification that this standby server has written it (but not yet flushed it or applied it). This can be used to gauge the delay that <literal>synchronous_commit</literal> level <literal>remote_write</literal> incurred while committing if this server was configured as a synchronous standby. 最近のWALをローカルにフラッシュしてから、このスタンバイサーバがそれを書き出した(が、まだフラッシュしたり適用したりしていない)ことの通知を受け取るまでの経過時間です。 このサーバが同期スタンバイとして設定されているとして、コミット時にsynchronous_commitレベルのremote_writeが起こした遅延を正確に測定するために、これを使用することができます。

flush_lag interval

Time elapsed between flushing recent WAL locally and receiving notification that this standby server has written and flushed it (but not yet applied it). This can be used to gauge the delay that <literal>synchronous_commit</literal> level <literal>on</literal> incurred while committing if this server was configured as a synchronous standby. 最近のWALをローカルにフラッシュしてから、このスタンバイサーバがそれを書き出してフラッシュした(が、まだ適用していない)ことの通知を受け取るまでの経過時間です。 このサーバが同期スタンバイとして設定されているとして、コミット時にsynchronous_commitレベルのonが起こした遅延を正確に測定するために、これを使用することができます。

replay_lag interval

Time elapsed between flushing recent WAL locally and receiving notification that this standby server has written, flushed and applied it. This can be used to gauge the delay that <literal>synchronous_commit</literal> level <literal>remote_apply</literal> incurred while committing if this server was configured as a synchronous standby. 最近のWALをローカルにフラッシュしてから、このスタンバイサーバがそれを書き出し、フラッシュし、そして適用したことの通知を受け取るまでの経過時間です。 このサーバが同期スタンバイとして設定されているとして、コミット時にsynchronous_commitレベルのremote_applyが起こした遅延を正確に測定するために、これを使用することができます。

sync_priority integer

Priority of this standby server for being chosen as the synchronous standby in a priority-based synchronous replication. This has no effect in a quorum-based synchronous replication. 優先度に基づく同期レプリケーションで、このスタンバイサーバが同期スタンバイとして選択される優先度です。 クォーラムに基づく同期レプリケーションでは効果がありません。

sync_state text

Synchronous state of this standby server. Possible values are: このスタンバイサーバの同期状態です。 取り得る値は以下の通りです。

  • <literal>async</literal>: This standby server is asynchronous. async: このスタンバイサーバは非同期です。

  • <literal>potential</literal>: This standby server is now asynchronous, but can potentially become synchronous if one of current synchronous ones fails. potential: このスタンバイサーバは現在非同期ですが、現在同期中のサーバの一つが故障すると同期になる可能性があります。

  • <literal>sync</literal>: This standby server is synchronous. sync: このスタンバイサーバは同期です。

  • <literal>quorum</literal>: This standby server is considered as a candidate for quorum standbys. quorum: このサーバはクォーラムのスタンバイの候補とみなされています。

reply_time timestamp with time zone

Send time of last reply message received from standby server スタンバイサーバから受け取った最後の応答メッセージの送信時刻です。


The lag times reported in the <structname>pg_stat_replication</structname> view are measurements of the time taken for recent WAL to be written, flushed and replayed and for the sender to know about it. These times represent the commit delay that was (or would have been) introduced by each synchronous commit level, if the remote server was configured as a synchronous standby. For an asynchronous standby, the <structfield>replay_lag</structfield> column approximates the delay before recent transactions became visible to queries. If the standby server has entirely caught up with the sending server and there is no more WAL activity, the most recently measured lag times will continue to be displayed for a short time and then show NULL. pg_stat_replicationビューで報告される経過時間は、最近のWALが書き込まれ、フラッシュされ、再生されるのに要した時間の測定結果であり、また、送信サーバがそれを知るためのものです。 リモートサーバが同期スタンバイとして設定されている場合、これらの時間は、同期コミットの各レベルによって引き起こされた(あるいは引き起こされたであろう)コミットの遅延を表します。 非同期スタンバイの場合は、replay_lag列は最近のトランザクションが問い合わせに対して可視になったときまでの遅延を近似します。 スタンバイサーバが送信サーバに完全に追いつき、WALの活動がなくなった状態のときは、最も直近に測定された経過時間が短い間、表示され続け、その後はNULLとなります。

Lag times work automatically for physical replication. Logical decoding plugins may optionally emit tracking messages; if they do not, the tracking mechanism will simply display NULL lag. 経過時間は物理レプリケーションの場合は自動的に機能します。 ロジカルデコーディングのプラグインはオプションで追跡メッセージを発することができますが、そうしなければ追跡機能は単にNULLの経過時間を表示します。

注記

The reported lag times are not predictions of how long it will take for the standby to catch up with the sending server assuming the current rate of replay. Such a system would show similar times while new WAL is being generated, but would differ when the sender becomes idle. In particular, when the standby has caught up completely, <structname>pg_stat_replication</structname> shows the time taken to write, flush and replay the most recent reported WAL location rather than zero as some users might expect. This is consistent with the goal of measuring synchronous commit and transaction visibility delays for recent write transactions. To reduce confusion for users expecting a different model of lag, the lag columns revert to NULL after a short time on a fully replayed idle system. Monitoring systems should choose whether to represent this as missing data, zero or continue to display the last known value. 報告される経過時間は、現在の再生速度の前提でスタンバイが送信サーバに追いつくのに要する時間を予測するものではありません。 そのようなシステムでは、新しいWALが生成されている間は類似した時間を示しますが、送信サーバがアイドル状態になると異なるものになるでしょう。 特に、スタンバイが完全に追いついたとき、pg_stat_replicationは、一部のユーザが期待するゼロではなく、最も最近に報告されたWAL位置を書き込み、フラッシュし、再生するのに要した時間を示します。 これは最近の書き込みトランザクションについて同期コミットおよびトランザクションの可視性の遅延を測定するという目的と首尾一貫しています。 経過時間について異なるモデルを期待するユーザの混乱を抑えるため、完全に再生されてアイドルになったシステムでは、経過時間の列は短い時間の後、NULLに戻ります。 監視システムでは、これをデータなしとする、ゼロとする、あるいは最後の既知の値を表示し続けるという選択をすることになります。

28.2.5. pg_stat_replication_slots #

The <structname>pg_stat_replication_slots</structname> view will contain one row per logical replication slot, showing statistics about its usage. pg_stat_replication_slotsビューには、論理レプリケーションスロットごとに1行が含まれ、その使用状況に関する統計情報が表示されます。

表28.15 pg_stat_replication_slotsビュー

<title><structname>pg_stat_replication_slots</structname> View</title>

Column Type 列 型

Description 説明

slot_name text

A unique, cluster-wide identifier for the replication slot クラスタ全体で一意なレプリケーションスロットの識別子です。

spill_txns bigint

Number of transactions spilled to disk once the memory used by logical decoding to decode changes from WAL has exceeded <literal>logical_decoding_work_mem</literal>. The counter gets incremented for both top-level transactions and subtransactions. WALからの変更をデコードするために論理デコードによって使用されるメモリがlogical_decoding_work_memを超えたときにディスクにあふれたトランザクション数です。 カウンタは、トップレベルのトランザクションとサブトランザクションの両方で増分されます。

spill_count bigint

Number of times transactions were spilled to disk while decoding changes from WAL for this slot. This counter is incremented each time a transaction is spilled, and the same transaction may be spilled multiple times. このスロットのWALから変更をデコードしている間に、トランザクションがディスクにあふれた回数です。 このカウンタは、トランザクションがあふれるたびに増分され、同じトランザクションが複数回あふれることもあります。

spill_bytes bigint

Amount of decoded transaction data spilled to disk while performing decoding of changes from WAL for this slot. This and other spill counters can be used to gauge the I/O which occurred during logical decoding and allow tuning <literal>logical_decoding_work_mem</literal>. このスロットのWALからの変更をデコード実行している間に、ディスクにあふれたデコード済みトランザクションデータ量です。 このカウンタと他のあふれカウンタは、論理デコード中に発生したI/Oを測定しlogical_decoding_work_memを調整できます。

stream_txns bigint

Number of in-progress transactions streamed to the decoding output plugin after the memory used by logical decoding to decode changes from WAL for this slot has exceeded <literal>logical_decoding_work_mem</literal>. Streaming only works with top-level transactions (subtransactions can't be streamed independently), so the counter is not incremented for subtransactions. このスロットのWALからの変更をデコードするために論理デコードが使用するメモリがlogical_decoding_work_memを超えた後にデコード出力プラグインにストリーミングされた進行中のトランザクション数です。 ストリーミングはトップレベルのトランザクションでのみ機能するため (サブトランザクションは独立してストリーミングできません)、サブトランザクションではカウンタは増分されません。

stream_countbigint

Number of times in-progress transactions were streamed to the decoding output plugin while decoding changes from WAL for this slot. This counter is incremented each time a transaction is streamed, and the same transaction may be streamed multiple times. このスロットのWALからの変更をデコードしている間に、進行中のトランザクションがデコード出力プラグインにストリーミングされた回数です。 このカウンタは、トランザクションがストリーミングされるたびに増分され、同じトランザクションが複数回ストリーミングされる可能性があります。

stream_bytesbigint

Amount of transaction data decoded for streaming in-progress transactions to the decoding output plugin while decoding changes from WAL for this slot. This and other streaming counters for this slot can be used to tune <literal>logical_decoding_work_mem</literal>. このスロットのWALからの変更をデコードしている間に、進行中のトランザクションをデコード出力プラグインにストリーミングするためにデコードされたトランザクションデータ量です。 このカウンタと他のストリーミングカウンタは、logical_decoding_work_memを調整するために使用できます。

total_txns bigint

Number of decoded transactions sent to the decoding output plugin for this slot. This counts top-level transactions only, and is not incremented for subtransactions. Note that this includes the transactions that are streamed and/or spilled. このスロットのデコード出力プラグインに送信されたデコードされたトランザクション数です。 これはトップレベルのトランザクションのみ数えられ、サブトランザクションは数えられません。 これには、ストリーミングされたトランザクションやあふれたトランザクションが含まれることに注意してください。

total_bytesbigint

Amount of transaction data decoded for sending transactions to the decoding output plugin while decoding changes from WAL for this slot. Note that this includes data that is streamed and/or spilled. このスロットのWALからの変更をデコードしながら、デコード出力プラグインにトランザクションを送信するためにデコードされたトランザクションデータ量です。 これには、ストリーミングされたデータやあふれたデータが含まれることに注意してください。

stats_reset timestamp with time zone

Time at which these statistics were last reset 統計情報がリセットされた最終時刻です。


28.2.6. pg_stat_wal_receiver #

The <structname>pg_stat_wal_receiver</structname> view will contain only one row, showing statistics about the WAL receiver from that receiver's connected server. pg_stat_wal_receiverビューは、1行のみの形式で、受信サーバが接続したサーバからWALレシーバに関する統計情報を表示します。

表28.16 pg_stat_wal_receiverビュー

<title><structname>pg_stat_wal_receiver</structname> View</title>

Column Type 列 型

Description 説明

pid integer

Process ID of the WAL receiver process WALレシーバプロセスのプロセスIDです。

status text

Activity status of the WAL receiver process WALレシーバプロセスの活動状態です。

receive_start_lsn pg_lsn

First write-ahead log location used when WAL receiver is started WALレシーバが開始された時に使われる先行書き込みログの最初の位置です。

receive_start_tli integer

First timeline number used when WAL receiver is started WALレシーバが開始された時に使われる初期タイムライン番号です。

written_lsn pg_lsn

Last write-ahead log location already received and written to disk, but not flushed. This should not be used for data integrity checks. すでに受信し、ディスクに書き出されたもののまだフラッシュされていない先行書き込みログの最新位置です。 これはデータの完全性の確認のためには使うべきではありません。

flushed_lsn pg_lsn

Last write-ahead log location already received and flushed to disk, the initial value of this field being the first log location used when WAL receiver is started すでに受信し、ディスクにフラッシュされた先行書き込みログの最新位置です。 この列の初期値は、WALレシーバが開始された時に使用される、最初のログ位置です。

received_tli integer

Timeline number of last write-ahead log location received and flushed to disk, the initial value of this field being the timeline number of the first log location used when WAL receiver is started 受信済みでディスクにフラッシュされた先行書き込みログの最新位置のタイムライン番号です。 この列の初期値は、WALレシーバが開始された時に使用される、最初のログ位置のタイムライン番号です。

last_msg_send_time timestamp with time zone

Send time of last message received from origin WAL sender オリジンWAL送信サーバから受け取った最後のメッセージの送信時刻です。

last_msg_receipt_time timestamp with time zone

Receipt time of last message received from origin WAL sender オリジンWAL送信サーバから受け取った最後のメッセージの受信時刻です。

latest_end_lsn pg_lsn

Last write-ahead log location reported to origin WAL sender オリジンWAL送信サーバに最後に報告された先行書き込みログ位置です。

latest_end_time timestamp with time zone

Time of last write-ahead log location reported to origin WAL sender オリジンWAL送信サーバへ最新の先行書き込みログ位置が報告された時間です。

slot_name text

Replication slot name used by this WAL receiver WALレシーバによって使用されたレプリケーションスロット名です。

sender_host text

Host of the <productname>PostgreSQL</productname> instance this WAL receiver is connected to. This can be a host name, an IP address, or a directory path if the connection is via Unix socket. (The path case can be distinguished because it will always be an absolute path, beginning with <literal>/</literal>.) WALレシーバーが接続しているPostgreSQLインスタンスのホストです。 これはホスト名、IPアドレス、あるいはUNIXソケットで接続している場合はディレクトリのパスです。 (パスは、常に/で始まる絶対パスなので、パスであることを識別できます。)

sender_port integer

Port number of the <productname>PostgreSQL</productname> instance this WAL receiver is connected to. WALレシーバーが接続しているPostgreSQLインスタンスのポート番号です。

conninfo text

Connection string used by this WAL receiver, with security-sensitive fields obfuscated. セキュリティに重要な値が難読化された文字列を含む、WALレシーバによって使用された接続文字列です。


28.2.7. pg_stat_recovery_prefetch #

The <structname>pg_stat_recovery_prefetch</structname> view will contain only one row. The columns <structfield>wal_distance</structfield>, <structfield>block_distance</structfield> and <structfield>io_depth</structfield> show current values, and the other columns show cumulative counters that can be reset with the <function>pg_stat_reset_shared</function> function. pg_stat_recovery_prefetchビューは1行のみの形式です。 wal_distanceblock_distanceio_depthの列は現在の値を示し、他の列はpg_stat_reset_shared関数でリセット可能な累積カウンタを示します。

表28.17 pg_stat_recovery_prefetchビュー

<title><structname>pg_stat_recovery_prefetch</structname> View</title>

Column Type 列 型

Description 説明

stats_reset timestamp with time zone

Time at which these statistics were last reset 統計情報がリセットされた最終時刻です。

prefetch bigint

Number of blocks prefetched because they were not in the buffer pool バッファプールになかったためにプリフェッチされたブロックの数です。

hit bigint

Number of blocks not prefetched because they were already in the buffer pool すでにバッファプールにあったためプリフェッチされなかったブロックの数です。

skip_init bigint

Number of blocks not prefetched because they would be zero-initialized ゼロで初期化されるためプリフェッチされなかったブロックの数です。

skip_new bigint

Number of blocks not prefetched because they didn't exist yet まだ存在しなかったためにプリフェッチされなかったブロックの数です。

skip_fpw bigint

Number of blocks not prefetched because a full page image was included in the WAL フルページイメージがWALに含まれていたためにプリフェッチされなかったブロックの数です。

skip_rep bigint

Number of blocks not prefetched because they were already recently prefetched すでに最近プリフェッチされていたためにプリフェッチされなかったブロックの数です。

wal_distance int

How many bytes ahead the prefetcher is looking プリフェッチャーが参照しているバイト数です。

block_distance int

How many blocks ahead the prefetcher is looking プリフェッチャーが参照している前方のブロック数です。

io_depth int

How many prefetches have been initiated but are not yet known to have completed 開始されたがまだ完了していないプリフェッチの数です。


28.2.8. pg_stat_subscription #

表28.18 pg_stat_subscriptionビュー

<title><structname>pg_stat_subscription</structname> View</title>

Column Type 列 型

Description 説明

subid oid

OID of the subscription サブスクリプションのOIDです。

subname name

Name of the subscription サブスクリプションの名前です。

pid integer

Process ID of the subscription worker process サブスクリプションのワーカープロセスのプロセスIDです。

leader_pid integer

Process ID of the leader apply worker if this process is a parallel apply worker; NULL if this process is a leader apply worker or a synchronization worker 《機械翻訳》このプロセスがパラレル適用ワーカーの場合は、リーダー適用ワーカーのプロセスID。 このプロセスがリーダー適用ワーカーまたは同期ワーカーの場合はNULL。

relid oid

OID of the relation that the worker is synchronizing; NULL for the leader apply worker and parallel apply workers 《マッチ度[64.601770]》ワーカーが同期しているリレーションのOIDです。メインの適用ワーカーの場合はNULLです。 《機械翻訳》ワーカーが同期しているリレーションのOID。 リーダー・適用ワーカーの場合はNULL。

received_lsn pg_lsn

Last write-ahead log location received, the initial value of this field being 0; NULL for parallel apply workers 《マッチ度[58.035714]》最後に受け取った先行書き込みログ位置です。このフィールドの初期値は0です。 《機械翻訳》最後に受信したwrite-ahead logの位置。 このフィールドの初期値は0。 パラレル適用ワーカーではNULL。

last_msg_send_time timestamp with time zone

Send time of last message received from origin WAL sender; NULL for parallel apply workers 《マッチ度[55.555556]》オリジンWAL送信サーバから受け取った最後のメッセージの送信時刻です。 《機械翻訳》最後のメッセージを送信した時刻。 パラレル適用ワーカーの場合は NULL。

last_msg_receipt_time timestamp with time zone

Receipt time of last message received from origin WAL sender; NULL for parallel apply workers 《マッチ度[56.989247]》オリジンWAL送信サーバから受け取った最後のメッセージの受信時刻です。 《機械翻訳》オリジナルのWAL送信者から受信した最後のメッセージの受信時刻。 パラレル適用ワーカーの場合はNULL。

latest_end_lsn pg_lsn

Last write-ahead log location reported to origin WAL sender; NULL for parallel apply workers 《マッチ度[56.521739]》オリジンWAL送信サーバに最後に報告された先行書き込みログ位置です。 《機械翻訳》最後の書き込みアボートログの位置。 WAL送信側に報告される。 並列適用ワーカーの場合はNULL。

latest_end_time timestamp with time zone

Time of last write-ahead log location reported to origin WAL sender; NULL for parallel apply workers 《マッチ度[60.000000]》オリジンWAL送信サーバに最後に報告された先行書き込みログ位置です。 《機械翻訳》最後の書き込みアボートログの位置が、WAL送信元に報告された時刻。 パラレル適用ワーカーの場合はNULL。


28.2.9. pg_stat_subscription_stats #

The <structname>pg_stat_subscription_stats</structname> view will contain one row per subscription. pg_stat_subscription_statsビューにはサブスクリプションごとに1行が含まれます。

表28.19 pg_stat_subscription_statsビュー

<title><structname>pg_stat_subscription_stats</structname> View</title>

Column Type 列 型

Description 説明

subid oid

OID of the subscription サブスクリプションのOIDです。

subname name

Name of the subscription サブスクリプションの名前です。

apply_error_count bigint

Number of times an error occurred while applying changes 変更の適用中にエラーが発生した回数です。

sync_error_count bigint

Number of times an error occurred during the initial table synchronization 初期テーブル同期中にエラーが発生した回数です。

stats_reset timestamp with time zone

Time at which these statistics were last reset 統計情報がリセットされた最終時刻です。


28.2.10. pg_stat_ssl #

The <structname>pg_stat_ssl</structname> view will contain one row per backend or WAL sender process, showing statistics about SSL usage on this connection. It can be joined to <structname>pg_stat_activity</structname> or <structname>pg_stat_replication</structname> on the <structfield>pid</structfield> column to get more details about the connection. pg_stat_sslビューは、バックエンドプロセスおよびWAL送信プロセスごとに1行を保持し、接続上でのSSLの使用に関する統計情報を示します。 pg_stat_activityまたはpg_stat_replicationpid列で結合することで、接続に関するより詳細な情報を取得できます。

表28.20 pg_stat_sslビュー

<title><structname>pg_stat_ssl</structname> View</title>

Column Type 列 型

Description 説明

pid integer

Process ID of a backend or WAL sender process バックエンドプロセスまたはWAL送信プロセスのプロセスIDです。

ssl boolean

True if SSL is used on this connection この接続でSSLが使用されていれば真になります。

version text

Version of SSL in use, or NULL if SSL is not in use on this connection 使用されているSSLのバージョンです。この接続でSSLが使用されていなければNULLになります。

cipher text

Name of SSL cipher in use, or NULL if SSL is not in use on this connection 使用されているSSL暗号の名前です。この接続でSSLが使用されていなければNULLになります。

bits integer

Number of bits in the encryption algorithm used, or NULL if SSL is not used on this connection 使用されている暗号アルゴリズムのビット数です。この接続でSSLが使用されていなければNULLになります。

client_dn text

Distinguished Name (DN) field from the client certificate used, or NULL if no client certificate was supplied or if SSL is not in use on this connection. This field is truncated if the DN field is longer than <symbol>NAMEDATALEN</symbol> (64 characters in a standard build). 使用されているクライアント証明書の識別名(DN)フィールドです。クライアント証明書が提供されなかった場合、およびこの接続でSSLが使用されていない場合はNULLになります。 このフィールドは、DNフィールドがNAMEDATALEN(標準ビルドでは64文字)より長いと切り詰められます。

client_serial numeric

Serial number of the client certificate, or NULL if no client certificate was supplied or if SSL is not in use on this connection. The combination of certificate serial number and certificate issuer uniquely identifies a certificate (unless the issuer erroneously reuses serial numbers). クライアント証明書のシリアル番号です。この接続でクライアント証明書が提供されていないかSSLが使われていない場合にNULLになります。 証明書のシリアル番号と証明書発行者の組み合わせは(発行者が誤ってシリアル番号を再使用しない限り)証明書を一意に識別します。

issuer_dn text

DN of the issuer of the client certificate, or NULL if no client certificate was supplied or if SSL is not in use on this connection. This field is truncated like <structfield>client_dn</structfield>. クライアント証明書の発行者のDNです。この接続でクライアント証明書が提供されていないかSSLが使われていない場合にNULLになります。 このフィールドはclient_dnと同様に切り詰められます。


28.2.11. pg_stat_gssapi #

The <structname>pg_stat_gssapi</structname> view will contain one row per backend, showing information about GSSAPI usage on this connection. It can be joined to <structname>pg_stat_activity</structname> or <structname>pg_stat_replication</structname> on the <structfield>pid</structfield> column to get more details about the connection. pg_stat_gssapiビューはバックエンド毎に1行で構成され、接続でのGSSAPI使用に関する情報を表示します。 接続に関する更なる詳細を得るため、これをpg_stat_activitypg_stat_replicationpid列で結合できます。

表28.21 pg_stat_gssapiビュー

<title><structname>pg_stat_gssapi</structname> View</title>

Column Type 列 型

Description 説明

pid integer

Process ID of a backend バックエンドのプロセスIDです。

gss_authenticated boolean

True if GSSAPI authentication was used for this connection この接続にGSSAPI認証が使われていたなら真です。

principal text

Principal used to authenticate this connection, or NULL if GSSAPI was not used to authenticate this connection. This field is truncated if the principal is longer than <symbol>NAMEDATALEN</symbol> (64 characters in a standard build). この接続の認証に使われているプリンシパルです。接続の認証にGSSAPIが使われていない場合にはNULLです。 このフィールドはプリンシパルがNAMEDATALEN(標準ビルドでは64文字)よりも長い場合には切り詰められます。

encrypted boolean

True if GSSAPI encryption is in use on this connection この接続でGSSAPI暗号化が使われているなら真です。

credentials_delegated boolean

True if GSSAPI credentials were delegated on this connection. 《マッチ度[52.459016]》この接続にGSSAPI認証が使われていたなら真です。 《機械翻訳》この接続で GSSAPI 資格情報が委任された場合は、true です。


28.2.12. pg_stat_archiver #

The <structname>pg_stat_archiver</structname> view will always have a single row, containing data about the archiver process of the cluster. pg_stat_archiverビューは常に、クラスタのアーカイバプロセスに関するデータを含む1つの行を持ちます。

表28.22 pg_stat_archiverビュー

<title><structname>pg_stat_archiver</structname> View</title>

Column Type 列 型

Description 説明

archived_count bigint

Number of WAL files that have been successfully archived アーカイブに成功したWALファイルの数です。

last_archived_wal text

Name of the WAL file most recently successfully archived 最後にアーカイブに成功したWALファイルの名前です。

last_archived_time timestamp with time zone

Time of the most recent successful archive operation 最後にアーカイブに成功した操作の時刻です。

failed_count bigint

Number of failed attempts for archiving WAL files WALファイルのアーカイブに失敗した回数です。

last_failed_wal text

Name of the WAL file of the most recent failed archival operation 最後にアーカイブ操作に失敗したWALファイルの名前です。

last_failed_time timestamp with time zone

Time of the most recent failed archival operation 最後にアーカイブ操作に失敗した時刻です。

stats_reset timestamp with time zone

Time at which these statistics were last reset 統計情報がリセットされた最終時刻です。


Normally, WAL files are archived in order, oldest to newest, but that is not guaranteed, and does not hold under special circumstances like when promoting a standby or after crash recovery. Therefore it is not safe to assume that all files older than <structfield>last_archived_wal</structfield> have also been successfully archived. 通常、WALファイルは古いものから新しいものの順にアーカイブされますが、これは保証されておらず、スタンバイをプロモートしたときやクラッシュリカバリ後のような特別な状況では保持されません。 したがって、last_archived_walより古いすべてのファイルも正常にアーカイブされたと考えるのは安全ではありません。

28.2.13. pg_stat_io #

The <structname>pg_stat_io</structname> view will contain one row for each combination of backend type, target I/O object, and I/O context, showing cluster-wide I/O statistics. Combinations which do not make sense are omitted. 《機械翻訳》pg_stat_ioビューには、バックエンドのタイプ、ターゲットI/Oオブジェクト、およびI/Oコンテキストの各組み合わせに対する1行が含まれ、クラスタ全体のI/O統計が示されます。 意味のない組み合わせは省略されます。

Currently, I/O on relations (e.g. tables, indexes) is tracked. However, relation I/O which bypasses shared buffers (e.g. when moving a table from one tablespace to another) is currently not tracked. 《機械翻訳》現在、リレーション(テーブル、インデックス)上の I/O は追跡されます。 ただし、共有バッファをバイパスするリレーション I/O(たとえば、あるテーブルスペースから別のテーブルスペースにテーブルを移動するとき)は現在は追跡されません。

表28.23 pg_stat_io View

Column Type 列 型

Description 説明

backend_type text

Type of backend (e.g. background worker, autovacuum worker). See <link linkend="monitoring-pg-stat-activity-view"> <structname>pg_stat_activity</structname></link> for more information on <varname>backend_type</varname>s. Some <varname>backend_type</varname>s do not accumulate I/O operation statistics and will not be included in the view. 《機械翻訳》バックエンドのタイプ (バックグラウンドワーカー、自動バキュームワーカーなど)。 backend_typeの詳細についてはpg_stat_activityを参照してください。 一部のbackend_typeはI/O操作統計を累積しないため、このビューには含まれません。

object text

Target object of an I/O operation. Possible values are: 《機械翻訳》I/O操作のターゲット・オブジェクト。 可能な値は次のとおりです。

  • relation: Permanent relations.

  • <literal>temp relation</literal>: Temporary relations. 《機械翻訳》temp relation: 一時的なリレーション。

context text

The context of an I/O operation. Possible values are: 《機械翻訳》I/O 操作のコンテキスト。 可能な値は次のとおりです。

  • <literal>normal</literal>: The default or standard <varname>context</varname> for a type of I/O operation. For example, by default, relation data is read into and written out from shared buffers. Thus, reads and writes of relation data to and from shared buffers are tracked in <varname>context</varname> <literal>normal</literal>. 《機械翻訳》normal: I/O操作のタイプに対するデフォルトまたは標準のcontextです。 例えば、リレーションデータの読み込みと書き込みは、デフォルトで共有バッファに書き込まれます。 したがって、共有バッファからのリレーションデータの読み込みと書き込みは、context normalで追跡されます。

  • <literal>vacuum</literal>: I/O operations performed outside of shared buffers while vacuuming and analyzing permanent relations. Temporary table vacuums use the same local buffer pool as other temporary table IO operations and are tracked in <varname>context</varname> <literal>normal</literal>. 《機械翻訳》vacuum: 永続的なリレーションのバキュームおよび解析中に共有バッファ外で実行されたI/O操作。 一時テーブルのバキュームは、他の一時テーブルI/O操作と同じローカルバッファプールを使用し、context normalで追跡されます。

  • <literal>bulkread</literal>: Certain large read I/O operations done outside of shared buffers, for example, a sequential scan of a large table. 《機械翻訳》bulkread: 大きな読み取りI/O操作(大きなテーブルの逐次スキャンなど)で、共有バッファの外部で行われるもの。

  • <literal>bulkwrite</literal>: Certain large write I/O operations done outside of shared buffers, such as <command>COPY</command>. 《機械翻訳》bulkwrite: COPYなどの共有バッファ外で行われる、大きな書き込みI/O操作。

reads bigint

Number of read operations, each of the size specified in <varname>op_bytes</varname>. 《機械翻訳》op_bytesで指定されたサイズの読み取り操作の数。

read_time double precision

Time spent in read operations in milliseconds (if <xref linkend="guc-track-io-timing"/> is enabled, otherwise zero) 《機械翻訳》読み取り操作に費やした時間(ミリ秒単位)(track_io_timingが有効な場合はゼロ)

writes bigint

Number of write operations, each of the size specified in <varname>op_bytes</varname>. 《機械翻訳》op_bytesで指定されたサイズの書き込み操作の数。

write_time double precision

Time spent in write operations in milliseconds (if <xref linkend="guc-track-io-timing"/> is enabled, otherwise zero) 《機械翻訳》書き込み操作に費やした時間(ミリ秒単位)(track_io_timingが有効な場合は0)

writebacks bigint

Number of units of size <varname>op_bytes</varname> which the process requested the kernel write out to permanent storage. 《機械翻訳》プロセスがカーネルに永続的な記憶域への書き出しを要求したop_bytesのサイズの数。

writeback_time double precision

Time spent in writeback operations in milliseconds (if <xref linkend="guc-track-io-timing"/> is enabled, otherwise zero). This includes the time spent queueing write-out requests and, potentially, the time spent to write out the dirty data. 《機械翻訳》ライトバック操作に費やした時間(ミリ秒単位)(track_io_timingが有効な場合、そうでない場合はゼロ)。 これには、書き出し要求の待ち時間と、書き出しデータの書き出しに費やした時間が含まれます。

extends bigint

Number of relation extend operations, each of the size specified in <varname>op_bytes</varname>. 《機械翻訳》op_bytesで指定されたサイズのリレーション拡張操作の数。

extend_time double precision

Time spent in extend operations in milliseconds (if <xref linkend="guc-track-io-timing"/> is enabled, otherwise zero) 《機械翻訳》拡張操作に費やした時間(ミリ秒単位)(track_io_timingが有効な場合はゼロ)

op_bytes bigint

The number of bytes per unit of I/O read, written, or extended. 《機械翻訳》I/Oの読み取り、書き込み、または拡張の単位ごとのバイト数。

Relation data reads, writes, and extends are done in <varname>block_size</varname> units, derived from the build-time parameter <symbol>BLCKSZ</symbol>, which is <literal>8192</literal> by default. 《機械翻訳》リレーションデータの読み込み、書き込み、拡張は、構築時パラメータBLCKSZから導出されるblock_size単位で行われます。 デフォルトでは8192です。

hits bigint

The number of times a desired block was found in a shared buffer. 《機械翻訳》共有バッファ内で所望のブロックが見つかった回数。

evictions bigint

Number of times a block has been written out from a shared or local buffer in order to make it available for another use. 《機械翻訳》ブロックが別の使用に使用できるように、共有バッファまたはローカルバッファから書き出された回数。

In <varname>context</varname> <literal>normal</literal>, this counts the number of times a block was evicted from a buffer and replaced with another block. In <varname>context</varname>s <literal>bulkwrite</literal>, <literal>bulkread</literal>, and <literal>vacuum</literal>, this counts the number of times a block was evicted from shared buffers in order to add the shared buffer to a separate, size-limited ring buffer for use in a bulk I/O operation. 《機械翻訳》contextnormalの場合、この値は、ブロックがバッファから削除され、別のブロックに置き換えられた回数をカウントします。 contextbulkwritebulkread、およびvacuumの場合、この値は、バルクI/O操作で使用するために、共有バッファを別のサイズ制限のあるリングバッファに追加するために、ブロックが共有バッファから追い出された回数をカウントします。

reuses bigint

The number of times an existing buffer in a size-limited ring buffer outside of shared buffers was reused as part of an I/O operation in the <literal>bulkread</literal>, <literal>bulkwrite</literal>, or <literal>vacuum</literal> <varname>context</varname>s. 《機械翻訳》共有バッファ以外のサイズ制限付きリングバッファ内の既存のバッファが、bulkreadbulkwrite、またはvacuum context内でI/O操作の一部として再利用された回数。

fsyncs bigint

Number of <literal>fsync</literal> calls. These are only tracked in <varname>context</varname> <literal>normal</literal>. 《機械翻訳》fsync呼び出しの数。 これらはcontext normalでのみ追跡されます。

fsync_time double precision

Time spent in fsync operations in milliseconds (if <xref linkend="guc-track-io-timing"/> is enabled, otherwise zero) 《機械翻訳》fsync操作に費やした時間(ミリ秒単位)(track_io_timingが有効な場合は0)

stats_reset timestamp with time zone

Time at which these statistics were last reset. 《マッチ度[82.978723]》統計情報がリセットされた最終時刻です。 《機械翻訳》これらの統計情報が最後にリセットされた時刻。


Some backend types never perform I/O operations on some I/O objects and/or in some I/O contexts. These rows are omitted from the view. For example, the checkpointer does not checkpoint temporary tables, so there will be no rows for <varname>backend_type</varname> <literal>checkpointer</literal> and <varname>object</varname> <literal>temp relation</literal>. 《機械翻訳》一部のバックエンドタイプは、一部のI/Oオブジェクトおよび/または一部のI/OコンテキストでI/O操作を実行しません。 これらの行はビューから省略されます。 たとえば、チェッカポインタは一時テーブルをチェックしないので、backend_type checkpointerおよびobject temp relationに対する行はありません。

In addition, some I/O operations will never be performed either by certain backend types or on certain I/O objects and/or in certain I/O contexts. These cells will be NULL. For example, temporary tables are not <literal>fsync</literal>ed, so <varname>fsyncs</varname> will be NULL for <varname>object</varname> <literal>temp relation</literal>. Also, the background writer does not perform reads, so <varname>reads</varname> will be NULL in rows for <varname>backend_type</varname> <literal>background writer</literal>. 《機械翻訳》また、特定のバックエンドタイプ、特定のI/Oオブジェクト、特定のI/Oコンテキストで、一部のI/O操作が実行されない場合もあります。 これらのセルはNULLです。 たとえば、一時テーブルはfsyncされないので、fsyncsobject temp relationに対してNULLになります。 また、バックグラウンドライタは読み取りを行わないので、backend_typetemp relationの行ではreadsがNULLになります。

<structname>pg_stat_io</structname> can be used to inform database tuning. For example: 《機械翻訳》pg_stat_ioはデータベースのチューニングに役立てることができます。 たとえば、

  • A high <varname>evictions</varname> count can indicate that shared buffers should be increased. 《機械翻訳》evictionsの数が多いということは、共有バッファを増やす必要があることを示しています。

  • Client backends rely on the checkpointer to ensure data is persisted to permanent storage. Large numbers of <varname>fsyncs</varname> by <literal>client backend</literal>s could indicate a misconfiguration of shared buffers or of the checkpointer. More information on configuring the checkpointer can be found in <xref linkend="wal-configuration"/>. 《機械翻訳》クライアントバックエンドは、チェックポインタが永続的なストレージにデータが保存されていることを確認するために、チェックポインタに依存します。 クライアントバッファによる多数のfsyncは、共有バッファやチェックポインタの設定ミスを示している可能性があります。 チェックポインタの設定の詳細は30.5を参照してください。

  • Normally, client backends should be able to rely on auxiliary processes like the checkpointer and the background writer to write out dirty data as much as possible. Large numbers of writes by client backends could indicate a misconfiguration of shared buffers or of the checkpointer. More information on configuring the checkpointer can be found in <xref linkend="wal-configuration"/>. 《機械翻訳》通常、クライアントバックエンドは、チェックポインタやバックグラウンドライタのような補助プロセスに、できるだけ多くの不正なデータを書き出すことに依存できるはずです。 クライアントバックエンドによる大量の書き込みは、共有バッファやチェックポインタの設定ミスを示している可能性があります。 チェックポインタの設定についての詳細は30.5を参照してください。

注記

Columns tracking I/O time will only be non-zero when <xref linkend="guc-track-io-timing"/> is enabled. The user should be careful when referencing these columns in combination with their corresponding IO operations in case <varname>track_io_timing</varname> was not enabled for the entire time since the last stats reset. 《機械翻訳》I/O時間を追跡する列は、track_io_timingが有効な場合にのみ非ゼロになります。 ユーザは、対応するIO操作を参照するときに、最後の統計リセット以降にtrack_io_timingが有効になっていなかった場合には注意が必要です。

28.2.14. pg_stat_bgwriter #

The <structname>pg_stat_bgwriter</structname> view will always have a single row, containing global data for the cluster. pg_stat_bgwriterビューは常に、クラスタのグローバルデータに関する1つの行を持ちます。

表28.24 pg_stat_bgwriterビュー

<title><structname>pg_stat_bgwriter</structname> View</title>

Column Type 列 型

Description 説明

checkpoints_timed bigint

Number of scheduled checkpoints that have been performed これまでに実行された、スケジュールされたチェックポイントの個数です。

checkpoints_req bigint

Number of requested checkpoints that have been performed これまでに実行された、要求されたチェックポイントの個数です。

checkpoint_write_time double precision

Total amount of time that has been spent in the portion of checkpoint processing where files are written to disk, in milliseconds チェックポイント処理におけるディスクにファイルを書き出す部分に費やされた、ミリ秒単位の総時間です。

checkpoint_sync_time double precision

Total amount of time that has been spent in the portion of checkpoint processing where files are synchronized to disk, in milliseconds チェックポイント処理におけるディスクにファイルを同期する部分に費やされた、ミリ秒単位の総時間です。

buffers_checkpoint bigint

Number of buffers written during checkpoints チェックポイント期間に書き出されたバッファ数です。

buffers_clean bigint

Number of buffers written by the background writer バックグラウンドライタにより書き出されたバッファ数です。

maxwritten_clean bigint

Number of times the background writer stopped a cleaning scan because it had written too many buffers バックグラウンドライタが書き出したバッファ数が多過ぎたために、整理用スキャンを停止した回数です。

buffers_backend bigint

Number of buffers written directly by a backend バックエンドにより直接書き出されたバッファ数です。

buffers_backend_fsync bigint

Number of times a backend had to execute its own <function>fsync</function> call (normally the background writer handles those even when the backend does its own write) バックエンドが独自にfsync呼び出しを実行しなければならなかった回数です。 (通常は、バックエンドが独自に書き込んだ場合であっても、バックグラウンドライタがこれらを扱います。)

buffers_alloc bigint

Number of buffers allocated 割当られたバッファ数です。

stats_reset timestamp with time zone

Time at which these statistics were last reset 統計情報がリセットされた最終時刻です。


28.2.15. pg_stat_wal #

The <structname>pg_stat_wal</structname> view will always have a single row, containing data about WAL activity of the cluster. pg_stat_walビューは常に、クラスタのWAL活動状況のデータに関する1つの行を持ちます。

表28.25 pg_stat_walビュー

<title><structname>pg_stat_wal</structname> View</title>

Column Type 列 型

Description 説明

wal_records bigint

Total number of WAL records generated 生成されたWALレコードの総数です。

wal_fpi bigint

Total number of WAL full page images generated 生成されたWALフルページイメージの総数です。

wal_bytes numeric

Total amount of WAL generated in bytes 生成されたWALのバイト単位の総量です。

wal_buffers_full bigint

Number of times WAL data was written to disk because WAL buffers became full WALバッファが満杯になったため、WALデータがディスクに書き込まれた回数です。

wal_write bigint

Number of times WAL buffers were written out to disk via <function>XLogWrite</function> request. See <xref linkend="wal-configuration"/> for more information about the internal WAL function <function>XLogWrite</function>. WALバッファがXLogWrite要求によりディスクに書き出された回数です。 内部WAL関数XLogWriteの詳細については、30.5を参照してください。

wal_sync bigint

Number of times WAL files were synced to disk via <function>issue_xlog_fsync</function> request (if <xref linkend="guc-fsync"/> is <literal>on</literal> and <xref linkend="guc-wal-sync-method"/> is either <literal>fdatasync</literal>, <literal>fsync</literal> or <literal>fsync_writethrough</literal>, otherwise zero). See <xref linkend="wal-configuration"/> for more information about the internal WAL function <function>issue_xlog_fsync</function>. WALファイルがissue_xlog_fsync要求によりディスクに同期された回数(fsynconかつwal_sync_methodfdatasyncまたはfsyncまたはfsync_writethroughのいずれかである場合、そうでなければゼロ)です。 内部WAL関数issue_xlog_fsyncの詳細については、30.5を参照してください。

wal_write_time double precision

Total amount of time spent writing WAL buffers to disk via <function>XLogWrite</function> request, in milliseconds (if <xref linkend="guc-track-wal-io-timing"/> is enabled, otherwise zero). This includes the sync time when <varname>wal_sync_method</varname> is either <literal>open_datasync</literal> or <literal>open_sync</literal>. XLogWriteの要求を介してWALバッファをディスクに書き込むのに費やされたミリ秒単位の合計時間(track_wal_io_timing が有効である場合、そうでなければゼロ)です。 これにはwal_sync_methodopen_datasyncまたはopen_syncの場合の同期時間が含まれます。

wal_sync_time double precision

Total amount of time spent syncing WAL files to disk via <function>issue_xlog_fsync</function> request, in milliseconds (if <varname>track_wal_io_timing</varname> is enabled, <varname>fsync</varname> is <literal>on</literal>, and <varname>wal_sync_method</varname> is either <literal>fdatasync</literal>, <literal>fsync</literal> or <literal>fsync_writethrough</literal>, otherwise zero). issue_xlog_fsync要求を介してWALファイルのディスクへの同期に費やされたミリ秒単位の合計時間(track_wal_io_timingが有効、かつfsyncon、かつwal_sync_methodfdatasyncまたはfsyncまたはfsync_writethroughのいずれかの場合、それ以外の場合は0)です。

stats_reset timestamp with time zone

Time at which these statistics were last reset 統計情報がリセットされた最終時刻です。


28.2.16. pg_stat_database #

The <structname>pg_stat_database</structname> view will contain one row for each database in the cluster, plus one for shared objects, showing database-wide statistics. pg_stat_databaseビューには、クラスタ内のデータベース毎に1行と加えて共有オブジェクトのための1行が含まれ、データベース全体の統計情報を示します。

表28.26 pg_stat_databaseビュー

<title><structname>pg_stat_database</structname> View</title>

Column Type 列 型

Description 説明

datid oid

OID of this database, or 0 for objects belonging to a shared relation データベースのOIDです。共有リレーションに属するオブジェクトについては0になります。

datname name

Name of this database, or <literal>NULL</literal> for shared objects. データベース名です。共有オブジェクトについてはNULLになります。

numbackends integer

Number of backends currently connected to this database, or <literal>NULL</literal> for shared objects. This is the only column in this view that returns a value reflecting current state; all other columns return the accumulated values since the last reset. 現在データベースに接続しているバックエンドの個数です。共有オブジェクトについてはNULLになります。 これは、このビューの中で、現在の状態を反映した値を返す唯一の列です。 他の列はすべて、最後にリセットされてから累積された値を返します。

xact_commit bigint

Number of transactions in this database that have been committed データベース内でコミットされたトランザクション数です。

xact_rollback bigint

Number of transactions in this database that have been rolled back データベース内でロールバックされたトランザクション数です。

blks_read bigint

Number of disk blocks read in this database データベース内で読み取られたディスクブロック数です。

blks_hit bigint

Number of times disk blocks were found already in the buffer cache, so that a read was not necessary (this only includes hits in the PostgreSQL buffer cache, not the operating system's file system cache) バッファキャッシュに既にあることが分かっているためにディスクブロックの読み取りが不要だった回数です(これにはPostgreSQLのバッファキャッシュにおけるヒットのみが含まれ、オペレーティングシステムのファイルシステムキャッシュは含まれません)。

tup_returned bigint

Number of live rows fetched by sequential scans and index entries returned by index scans in this database シーケンシャルスキャンとこのデータベース内のインデックススキャンによって返されたインデックスエントリから取り出された有効な行数です。

tup_fetched bigint

Number of live rows fetched by index scans in this database データベース内のインデックススキャンで取り出された有効な行数です。

tup_inserted bigint

Number of rows inserted by queries in this database データベース内の問い合わせで挿入された行数です。

tup_updated bigint

Number of rows updated by queries in this database データベース内の問い合わせで更新された行数です。

tup_deleted bigint

Number of rows deleted by queries in this database データベース内の問い合わせで削除された行数です。

conflicts bigint

Number of queries canceled due to conflicts with recovery in this database. (Conflicts occur only on standby servers; see <link linkend="monitoring-pg-stat-database-conflicts-view"> <structname>pg_stat_database_conflicts</structname></link> for details.) データベース内のリカバリで競合したためキャンセルされた問い合わせ数です。 (競合はスタンバイサーバ上でのみ起こります。 詳細についてはpg_stat_database_conflictsを参照してください。)

temp_files bigint

Number of temporary files created by queries in this database. All temporary files are counted, regardless of why the temporary file was created (e.g., sorting or hashing), and regardless of the <xref linkend="guc-log-temp-files"/> setting. データベース内の問い合わせによって書き出された一時ファイルの個数です。 一時ファイルが作成された理由(ソート処理やハッシュ処理)やlog_temp_filesの設定に関わらず、すべての一時ファイルが計上されます。

temp_bytes bigint

Total amount of data written to temporary files by queries in this database. All temporary files are counted, regardless of why the temporary file was created, and regardless of the <xref linkend="guc-log-temp-files"/> setting. データベース内の問い合わせによって一時ファイルに書き出されたデータ量です。 一時ファイルが作成された理由やlog_temp_filesの設定に関わらず、すべての一時ファイルが計上されます。

deadlocks bigint

Number of deadlocks detected in this database データベース内で検知されたデッドロック数です。

checksum_failures bigint

Number of data page checksum failures detected in this database (or on a shared object), or NULL if data checksums are not enabled. データベース(あるいは共有オブジェクト)内で検出されたデータページチェックサムの検査失敗数です。データチェックサムが無効の場合にはNULLです。

checksum_last_failure timestamp with time zone

Time at which the last data page checksum failure was detected in this database (or on a shared object), or NULL if data checksums are not enabled. データベース(または共有オブジェクト)内で最後にデータページチェックサムの検査失敗が検知された時刻です。データチェックサムが無効の場合にはNULLです。

blk_read_time double precision

Time spent reading data file blocks by backends in this database, in milliseconds (if <xref linkend="guc-track-io-timing"/> is enabled, otherwise zero) データベース内でバックエンドによりデータファイルブロックの読み取りに費やされた、ミリ秒単位の時間です(track_io_timingが有効な場合。そうでなければゼロです)。

blk_write_time double precision

Time spent writing data file blocks by backends in this database, in milliseconds (if <xref linkend="guc-track-io-timing"/> is enabled, otherwise zero) データベース内でバックエンドによりデータファイルブロックの書き出しに費やされた、ミリ秒単位の時間です(track_io_timingが有効な場合。そうでなければゼロです)。

session_time double precision

Time spent by database sessions in this database, in milliseconds (note that statistics are only updated when the state of a session changes, so if sessions have been idle for a long time, this idle time won't be included) このデータベースでデータベースセッションに費やされた、ミリ秒単位の時間です(統計はセッションの状態が変化したときのみ更新されるため、セッションが長い間アイドル状態の場合、このアイドル時間は含まれません)。

active_time double precision

Time spent executing SQL statements in this database, in milliseconds (this corresponds to the states <literal>active</literal> and <literal>fastpath function call</literal> in <link linkend="monitoring-pg-stat-activity-view"> <structname>pg_stat_activity</structname></link>) このデータベースでSQL文実行に費やされた、ミリ秒単位の時間です(これはpg_stat_activityactivefastpath function call状態に対応します)。

idle_in_transaction_time double precision

Time spent idling while in a transaction in this database, in milliseconds (this corresponds to the states <literal>idle in transaction</literal> and <literal>idle in transaction (aborted)</literal> in <link linkend="monitoring-pg-stat-activity-view"> <structname>pg_stat_activity</structname></link>) このデータベースでトランザクション中にアイドル状態であった、ミリ秒単位の時間です(これはpg_stat_activityidle in transactionidle in transaction (aborted)状態に対応します)。

sessions bigint

Total number of sessions established to this database このデータベースに対して確立されたセッションの総数です。

sessions_abandoned bigint

Number of database sessions to this database that were terminated because connection to the client was lost このデータベースに対するデータベースセッションのうち、クライアントとの接続が失われたために終了したセッションの数です。

sessions_fatal bigint

Number of database sessions to this database that were terminated by fatal errors このデータベースに対するデータベースセッションのうち、致命的なエラーによって終了したセッションの数です。

sessions_killed bigint

Number of database sessions to this database that were terminated by operator intervention このデータベースに対するデータベースセッションのうち、オペレータの介入によって終了したセッションの数です。

stats_reset timestamp with time zone

Time at which these statistics were last reset 統計情報がリセットされた最終時刻です。


28.2.17. pg_stat_database_conflicts #

The <structname>pg_stat_database_conflicts</structname> view will contain one row per database, showing database-wide statistics about query cancels occurring due to conflicts with recovery on standby servers. This view will only contain information on standby servers, since conflicts do not occur on primary servers. pg_stat_database_conflictsビューは、データベースごとに1行を保持し、スタンバイサーバでのリカバリと競合するためにキャンセルされた問い合わせに関するデータベース全体の統計情報を示します。 プライマリサーバでは競合は発生しませんので、スタンバイサーバ上の情報のみが保持されます。

表28.27 pg_stat_database_conflictsビュー

<title><structname>pg_stat_database_conflicts</structname> View</title>

Column Type 列 型

Description 説明

datid oid

OID of a database データベースのOIDです。

datname name

Name of this database データベースの名前です。

confl_tablespace bigint

Number of queries in this database that have been canceled due to dropped tablespaces データベースにおいて、削除されたテーブル空間のためにキャンセルされた問い合わせの個数です。

confl_lock bigint

Number of queries in this database that have been canceled due to lock timeouts データベースにおいて、ロック時間切れのためにキャンセルされた問い合わせの個数です。

confl_snapshot bigint

Number of queries in this database that have been canceled due to old snapshots データベースにおいて、古いスナップショットのためにキャンセルされた問い合わせの個数です。

confl_bufferpin bigint

Number of queries in this database that have been canceled due to pinned buffers データベースにおいて、ピンが付いたバッファのためにキャンセルされた問い合わせの個数です。

confl_deadlock bigint

Number of queries in this database that have been canceled due to deadlocks データベースにおいて、デッドロックのためにキャンセルされた問い合わせの個数です。

confl_active_logicalslot bigint

Number of uses of logical slots in this database that have been canceled due to old snapshots or too low a <xref linkend="guc-wal-level"/> on the primary 《機械翻訳》古いスナップショットまたはプライマリ上の低すぎるwal_levelにより取り消されたこのデータベース内の論理スロットの使用回数


28.2.18. pg_stat_all_tables #

The <structname>pg_stat_all_tables</structname> view will contain one row for each table in the current database (including TOAST tables), showing statistics about accesses to that specific table. The <structname>pg_stat_user_tables</structname> and <structname>pg_stat_sys_tables</structname> views contain the same information, but filtered to only show user and system tables respectively. pg_stat_all_tablesビューは現在のデータベース内のテーブル(TOASTテーブルを含む)ごと1行の形式で、特定のテーブルへのアクセスに関する統計情報を表示します。 pg_stat_user_tablesおよびpg_stat_sys_tablesビューにも同じ情報が含まれますが、それぞれユーザテーブルとシステムテーブルのみにフィルタされています。

表28.28 pg_stat_all_tablesビュー

<title><structname>pg_stat_all_tables</structname> View</title>

Column Type 列 型

Description 説明

relid oid

OID of a table テーブルのOIDです。

schemaname name

Name of the schema that this table is in テーブルが存在するスキーマの名前です。

relname name

Name of this table テーブルの名前です。

seq_scan bigint

Number of sequential scans initiated on this table テーブル上で初期化されたシーケンシャルスキャンの個数です。

last_seq_scan timestamp with time zone

The time of the last sequential scan on this table, based on the most recent transaction stop time 《機械翻訳》最新のトランザクション停止時刻に基づく、この表の最後の順次スキャンの時刻

seq_tup_read bigint

Number of live rows fetched by sequential scans シーケンシャルスキャンによって取り出された有効な行数です。

idx_scan bigint

Number of index scans initiated on this table テーブル上で開始されたインデックススキャンの実行回数です。

last_idx_scan timestamp with time zone

The time of the last index scan on this table, based on the most recent transaction stop time 《機械翻訳》最新のトランザクション停止時刻に基づく、このテーブルに対する最新のインデックススキャンの時刻

idx_tup_fetch bigint

Number of live rows fetched by index scans インデックススキャンによって取り出された有効な行数です。

n_tup_ins bigint

Total number of rows inserted 《マッチ度[75.862069]》挿入された行数です。 《機械翻訳》挿入された行の総数

n_tup_upd bigint

Total number of rows updated. (This includes row updates counted in <structfield>n_tup_hot_upd</structfield> and <structfield>n_tup_newpage_upd</structfield>, and remaining non-<acronym>HOT</acronym> updates.) 《機械翻訳》更新された行の総数。 (これには、n_tup_hot_updn_tup_newpage_updでカウントされた行更新と、HOT以外の残りの更新が含まれます。)

n_tup_del bigint

Total number of rows deleted 《マッチ度[75.000000]》削除された行数です。 《機械翻訳》削除された行の総数

n_tup_hot_upd bigint

Number of rows <link linkend="storage-hot">HOT updated</link>. These are updates where no successor versions are required in indexes. 《機械翻訳》行数HOT更新。 これらは、インデックスで後続のバージョンが必要ない更新です。

n_tup_newpage_upd bigint

Number of rows updated where the successor version goes onto a <emphasis>new</emphasis> heap page, leaving behind an original version with a <link linkend="storage-tuple-layout"><structfield>t_ctid</structfield> field</link> that points to a different heap page. These are always non-<acronym>HOT</acronym> updates. 《機械翻訳》後継バージョンが新しいヒープページに移動し、元のバージョンが別のヒープページを指すt_ctidフィールドを残して置かれるHOT更新の数です。 これらは常にHOT以外の更新です。

n_live_tup bigint

Estimated number of live rows 有効な行数の推定値です。

n_dead_tup bigint

Estimated number of dead rows 無効な行数の推定値です。

n_mod_since_analyze bigint

Estimated number of rows modified since this table was last analyzed このテーブルが最後に解析されてから変更された行数の推定値です。

n_ins_since_vacuum bigint

Estimated number of rows inserted since this table was last vacuumed このテーブルが最後にバキュームされてから挿入された行数の推定値です。

last_vacuum timestamp with time zone

Last time at which this table was manually vacuumed (not counting <command>VACUUM FULL</command>) テーブルが手作業でバキュームされた最終時刻です(VACUUM FULLは含まれません)。

last_autovacuum timestamp with time zone

Last time at which this table was vacuumed by the autovacuum daemon 自動バキュームデーモンによりテーブルがバキュームされた最終時刻です。

last_analyze timestamp with time zone

Last time at which this table was manually analyzed テーブルが手作業で解析された最終時刻です。

last_autoanalyze timestamp with time zone

Last time at which this table was analyzed by the autovacuum daemon 自動バキュームデーモンによりテーブルが解析された最終時刻です。

vacuum_count bigint

Number of times this table has been manually vacuumed (not counting <command>VACUUM FULL</command>) テーブルが手作業でバキュームされた回数です。(VACUUM FULLは含まれません)。

autovacuum_count bigint

Number of times this table has been vacuumed by the autovacuum daemon テーブルが自動バキュームデーモンによりバキュームされた回数です。

analyze_count bigint

Number of times this table has been manually analyzed テーブルが手作業で解析された回数です。

autoanalyze_count bigint

Number of times this table has been analyzed by the autovacuum daemon テーブルが自動バキュームデーモンによって解析された回数です。


28.2.19. pg_stat_all_indexes #

The <structname>pg_stat_all_indexes</structname> view will contain one row for each index in the current database, showing statistics about accesses to that specific index. The <structname>pg_stat_user_indexes</structname> and <structname>pg_stat_sys_indexes</structname> views contain the same information, but filtered to only show user and system indexes respectively. pg_stat_all_indexesビューは、現在のデータベース内のインデックスごとに1行の形式で、特定のインデックスへのアクセスに関する統計情報を表示します。 pg_stat_user_indexespg_stat_sys_indexesも同じ情報を保持しますが、ユーザ向けのインデックスとシステム向けのインデックスに対する行のみを保持するようにフィルタ処理されています。

表28.29 pg_stat_all_indexesビュー

<title><structname>pg_stat_all_indexes</structname> View</title>

Column Type 列 型

Description 説明

relid oid

OID of the table for this index このインデックスに対応するテーブルのOIDです。

indexrelid oid

OID of this index インデックスのOIDです。

schemaname name

Name of the schema this index is in インデックスが存在するスキーマの名前です。

relname name

Name of the table for this index このインデックスに対応するテーブルの名前です。

indexrelname name

Name of this index インデックスの名前です。

idx_scan bigint

Number of index scans initiated on this index インデックスに対して開始されたインデックススキャンの実行回数です。

last_idx_scan timestamp with time zone

The time of the last scan on this index, based on the most recent transaction stop time 《機械翻訳》最新のトランザクション停止時刻に基づく、このインデックスの最後のスキャン時刻

idx_tup_read bigint

Number of index entries returned by scans on this index インデックスに対するスキャンにより返されたインデックス項目の個数です。

idx_tup_fetch bigint

Number of live table rows fetched by simple index scans using this index インデックスを使用する単純なインデックススキャンによって取り出された有効テーブル行数です。


Indexes can be used by simple index scans, <quote>bitmap</quote> index scans, and the optimizer. In a bitmap scan the output of several indexes can be combined via AND or OR rules, so it is difficult to associate individual heap row fetches with specific indexes when a bitmap scan is used. Therefore, a bitmap scan increments the <structname>pg_stat_all_indexes</structname>.<structfield>idx_tup_read</structfield> count(s) for the index(es) it uses, and it increments the <structname>pg_stat_all_tables</structname>.<structfield>idx_tup_fetch</structfield> count for the table, but it does not affect <structname>pg_stat_all_indexes</structname>.<structfield>idx_tup_fetch</structfield>. The optimizer also accesses indexes to check for supplied constants whose values are outside the recorded range of the optimizer statistics because the optimizer statistics might be stale. 単純なインデックススキャン、ビットマップインデックススキャン、あるいはオプティマイザによりインデックスが使用されることがあります。 ビットマップスキャンでは、複数のインデックスの出力をANDやOR規則で組み合わせることができます。 このため、ビットマップスキャンが使用される場合、特定インデックスと個々のヒープ行の取り出しとを関連づけることが困難です。 したがってビットマップスキャンでは、使用したインデックスのpg_stat_all_indexes.idx_tup_read個数を増やし、そのテーブルのpg_stat_all_tables.idx_tup_fetch個数を増やしますが、pg_stat_all_indexes.idx_tup_fetchを変更しません。 オプティマイザもインデックスにアクセスし、提供された定数値がオプティマイザの統計情報に記録された範囲の外側にあるときに、それを検査します。 これはオプティマイザの統計情報が古いかもしれないからです。

注記

The <structfield>idx_tup_read</structfield> and <structfield>idx_tup_fetch</structfield> counts can be different even without any use of bitmap scans, because <structfield>idx_tup_read</structfield> counts index entries retrieved from the index while <structfield>idx_tup_fetch</structfield> counts live rows fetched from the table. The latter will be less if any dead or not-yet-committed rows are fetched using the index, or if any heap fetches are avoided by means of an index-only scan. idx_tup_readidx_tup_fetch個数は、ビットマップスキャンがまったく使用されていない場合でも異なります。 idx_tup_readはインデックスから取り出したインデックス項目を計上し、idx_tup_fetchはテーブルから取り出した有効行を計上するからです。 インデックスを用いて無効行やまだコミットされていない行が取り出された場合やインデックスオンリースキャン法によりヒープの取り出しが回避された場合に、後者は減少します。

28.2.20. pg_statio_all_tables #

The <structname>pg_statio_all_tables</structname> view will contain one row for each table in the current database (including TOAST tables), showing statistics about I/O on that specific table. The <structname>pg_statio_user_tables</structname> and <structname>pg_statio_sys_tables</structname> views contain the same information, but filtered to only show user and system tables respectively. pg_statio_all_tablesビューは現在のデータベース内のテーブル(TOASTテーブルを含む)ごとに1行の形式で、特定のテーブルのI/Oに関する統計情報を表示します。 pg_statio_user_tablespg_statio_sys_tablesには同じ情報が保持されますが、ユーザテーブルとシステムテーブルに関する行のみを持つようにフィルタ処理がなされています。

表28.30 pg_statio_all_tablesビュー

<title><structname>pg_statio_all_tables</structname> View</title>

Column Type 列 型

Description 説明

relid oid

OID of a table テーブルのOIDです。

schemaname name

Name of the schema that this table is in テーブルが存在するスキーマの名前です。

relname name

Name of this table テーブルの名前です。

heap_blks_read bigint

Number of disk blocks read from this table テーブルから読み取られたディスクブロック数です。

heap_blks_hit bigint

Number of buffer hits in this table テーブル内のバッファヒット数です。

idx_blks_read bigint

Number of disk blocks read from all indexes on this table テーブル上のすべてのインデックスから読み取られたディスクブロック数です。

idx_blks_hit bigint

Number of buffer hits in all indexes on this table テーブル上のすべてのインデックス内のバッファヒット数です。

toast_blks_read bigint

Number of disk blocks read from this table's TOAST table (if any) テーブルのTOASTテーブル(もしあれば)から読み取られたディスクブロック数です。

toast_blks_hit bigint

Number of buffer hits in this table's TOAST table (if any) テーブルのTOASTテーブル(もしあれば)におけるバッファヒット数です。

tidx_blks_read bigint

Number of disk blocks read from this table's TOAST table indexes (if any) テーブルのTOASTテーブルのインデックス(もしあれば)から読み取られたディスクブロック数です。

tidx_blks_hit bigint

Number of buffer hits in this table's TOAST table indexes (if any) テーブルのTOASTテーブルのインデックス(もしあれば)におけるバッファヒット数です。


28.2.21. pg_statio_all_indexes #

The <structname>pg_statio_all_indexes</structname> view will contain one row for each index in the current database, showing statistics about I/O on that specific index. The <structname>pg_statio_user_indexes</structname> and <structname>pg_statio_sys_indexes</structname> views contain the same information, but filtered to only show user and system indexes respectively. pg_statio_all_indexesビューは、現在のデータベース内のインデックスごとに1行の形式で、特定のインデックスへのI/Oに関する統計情報を表示します。 pg_statio_user_indexespg_statio_sys_indexesも同じ情報を保持しますが、それぞれユーザ向けのインデックスとシステム向けのインデックスに対する行のみを保持するようにフィルタ処理されています。

表28.31 pg_statio_all_indexesビュー

<title><structname>pg_statio_all_indexes</structname> View</title>

Column Type 列 型

Description 説明

relid oid

OID of the table for this index このインデックスに対応するテーブルのOIDです。

indexrelid oid

OID of this index インデックスのOIDです。

schemaname name

Name of the schema this index is in インデックスが存在するスキーマの名前です。

relname name

Name of the table for this index このインデックスに対応するテーブルの名前です。

indexrelname name

Name of this index インデックスの名前です。

idx_blks_read bigint

Number of disk blocks read from this index インデックスから読み取られたディスクブロック数です。

idx_blks_hit bigint

Number of buffer hits in this index インデックスにおけるバッファヒット数です。


28.2.22. pg_statio_all_sequences #

The <structname>pg_statio_all_sequences</structname> view will contain one row for each sequence in the current database, showing statistics about I/O on that specific sequence. pg_statio_all_sequencesビューは現在のデータベース内のシーケンスごとに1行の形式で、特定シーケンスにおけるI/Oに関する統計情報を表示します。

表28.32 pg_statio_all_sequencesビュー

<title><structname>pg_statio_all_sequences</structname> View</title>

Column Type 列 型

Description 説明

relid oid

OID of a sequence シーケンスのOIDです。

schemaname name

Name of the schema this sequence is in シーケンスが存在するスキーマの名前です。

relname name

Name of this sequence シーケンスの名前です。

blks_read bigint

Number of disk blocks read from this sequence シーケンスから読み取られたディスクブロック数です。

blks_hit bigint

Number of buffer hits in this sequence シーケンスにおけるバッファヒット数です。


28.2.23. pg_stat_user_functions #

The <structname>pg_stat_user_functions</structname> view will contain one row for each tracked function, showing statistics about executions of that function. The <xref linkend="guc-track-functions"/> parameter controls exactly which functions are tracked. pg_stat_user_functionsビューは追跡された関数ごとに1行の形式で、その関数の実行に関する統計情報を表示します。 track_functionsパラメータは関数が追跡されるかどうかを正確に制御します。

表28.33 pg_stat_user_functionsビュー

<title><structname>pg_stat_user_functions</structname> View</title>

Column Type 列 型

Description 説明

funcid oid

OID of a function 関数のOIDです。

schemaname name

Name of the schema this function is in 関数が存在するスキーマの名前です。

funcname name

Name of this function 関数の名前です。

calls bigint

Number of times this function has been called 関数が呼び出された回数です。

total_time double precision

Total time spent in this function and all other functions called by it, in milliseconds 関数とその関数から呼び出されるその他の関数で費やされた、ミリ秒単位の総時間です。

self_time double precision

Total time spent in this function itself, not including other functions called by it, in milliseconds その関数から呼び出されるその他の関数で費やされた時間を含まない、関数自身で費やされた、ミリ秒単位の総時間です。


28.2.24. pg_stat_slru #

<productname>PostgreSQL</productname> accesses certain on-disk information via <firstterm>SLRU</firstterm> (simple least-recently-used) caches. The <structname>pg_stat_slru</structname> view will contain one row for each tracked SLRU cache, showing statistics about access to cached pages. PostgreSQLSLRU(simple least-recently-used)キャッシュ経由で特定のディスク上の情報にアクセスします。 pg_stat_slruビューは、追跡されたSLRUキャッシュごとに1行の形式で、キャッシュされたページへのアクセスに関する統計情報を表示します。

表28.34 pg_stat_slruビュー

<title><structname>pg_stat_slru</structname> View</title>

Column Type 列 型

Description 説明

name text

Name of the SLRU SLRUの名前です。

blks_zeroed bigint

Number of blocks zeroed during initializations 初期化中にゼロにされたブロックの数です。

blks_hit bigint

Number of times disk blocks were found already in the SLRU, so that a read was not necessary (this only includes hits in the SLRU, not the operating system's file system cache) SLRUに既にあることが分かっているためにディスクブロックの読み取りが不要だった回数です(これにはSLRUにおけるヒットのみが含まれ、オペレーティングシステムのファイルシステムキャッシュは含まれません)。

blks_read bigint

Number of disk blocks read for this SLRU SLRUから読み取られたディスクブロック数です。

blks_written bigint

Number of disk blocks written for this SLRU SLRUに書き込まれたディスクブロック数です。

blks_exists bigint

Number of blocks checked for existence for this SLRU SLRUで存在を検査されたブロック数です。

flushes bigint

Number of flushes of dirty data for this SLRU SLRUでのダーティデータのフラッシュ数です。

truncates bigint

Number of truncates for this SLRU SLRUでの切り詰めの数です。

stats_reset timestamp with time zone

Time at which these statistics were last reset 統計情報がリセットされた最終時刻です。


28.2.25. 統計情報関数 #

<title>Statistics Functions</title>

Other ways of looking at the statistics can be set up by writing queries that use the same underlying statistics access functions used by the standard views shown above. For details such as the functions' names, consult the definitions of the standard views. (For example, in <application>psql</application> you could issue <literal>\d+ pg_stat_activity</literal>.) The access functions for per-database statistics take a database OID as an argument to identify which database to report on. The per-table and per-index functions take a table or index OID. The functions for per-function statistics take a function OID. Note that only tables, indexes, and functions in the current database can be seen with these functions. 統計情報を参照する他の方法は、上述の標準ビューによって使用される基礎的な統計情報アクセス関数と同じ関数を使用した問い合わせを作成することで設定することができます。 こうした関数の名前などに関する詳細については、標準ビューの定義を参照してください。 (例えばpsqlでは\d+ pg_stat_activityを発行してください。) データベースごとの統計情報についてのアクセス関数は、どのデータベースに対して報告するのかを識別するためにデータベースのOIDを取ります。 テーブルごと、インデックスごとの関数はテーブルの、もしくはインデックスのOIDを取ります。 関数ごとの統計情報の関数は、関数のOIDを取ります。 これらの関数を使用して参照できるテーブルとインデックス、および関数は現在のデータベース内のものだけであることに注意してください。

Additional functions related to the cumulative statistics system are listed in <xref linkend="monitoring-stats-funcs-table"/>. その他の累積統計システムに関連した関数を表 28.35に示します。

表28.35 その他の統計情報関数

<title>Additional Statistics Functions</title>

Function 関数

Description 説明

pg_backend_pid () → integer

Returns the process ID of the server process attached to the current session. 現在のセッションにアタッチされたサーバプロセスのプロセスIDを返します。

pg_stat_get_activity ( integer ) → setof record

Returns a record of information about the backend with the specified process ID, or one record for each active backend in the system if <literal>NULL</literal> is specified. The fields returned are a subset of those in the <structname>pg_stat_activity</structname> view. 指定されたプロセスIDに該当するバックエンドの情報のレコードを、NULLが指定された場合はシステム上のアクティブな各バックエンドに関するレコードを返します。 返される情報内容はpg_stat_activityの一部と同じです。

pg_stat_get_snapshot_timestamp () → timestamp with time zone

Returns the timestamp of the current statistics snapshot, or NULL if no statistics snapshot has been taken. A snapshot is taken the first time cumulative statistics are accessed in a transaction if <varname>stats_fetch_consistency</varname> is set to <literal>snapshot</literal> 現在の統計スナップショットのタイムスタンプを返します。 統計スナップショットが取得されていない場合はNULLを返します。 stats_fetch_consistencysnapshotに設定されている場合は、トランザクションで累積統計に初めてアクセスしたときにスナップショットが取得されます。

pg_stat_get_xact_blocks_fetched ( oid ) → bigint

Returns the number of block read requests for table or index, in the current transaction. This number minus <function>pg_stat_get_xact_blocks_hit</function> gives the number of kernel <function>read()</function> calls; the number of actual physical reads is usually lower due to kernel-level buffering. 現在のトランザクションにおけるテーブルまたはインデックスについてのブロック読み取り要求の数を返します。 この数からpg_stat_get_xact_blocks_hitを引いた数がカーネルread()呼び出しの数になります。 実際の物理的な読み取り数は通常、カーネルレベルのバッファリングにより低くなります。

pg_stat_get_xact_blocks_hit ( oid ) → bigint

Returns the number of block read requests for table or index, in the current transaction, found in cache (not triggering kernel <function>read()</function> calls). 現在トランザクションのテーブルまたはインデックスについて、キャッシュで検出されたブロック読み取り要求の数を返します(カーネルread()呼び出しを引き起こしません)。

pg_stat_clear_snapshot () → void

Discards the current statistics snapshot or cached information. 現在の統計スナップショットまたはキャッシュされた情報を破棄します。

pg_stat_reset () → void

Resets all statistics counters for the current database to zero. 現在のデータベースに関する統計情報カウンタすべてをゼロにリセットします。

This function is restricted to superusers by default, but other users can be granted EXECUTE to run the function. この関数はデフォルトでスーパーユーザに限定されていますが、関数を実行できるように他のユーザにEXECUTE権限を付与できます。

pg_stat_reset_shared ( text ) → void

Resets some cluster-wide statistics counters to zero, depending on the argument. The argument can be <literal>bgwriter</literal> to reset all the counters shown in the <structname>pg_stat_bgwriter</structname> view, <literal>archiver</literal> to reset all the counters shown in the <structname>pg_stat_archiver</structname> view, <literal>io</literal> to reset all the counters shown in the <structname>pg_stat_io</structname> view, <literal>wal</literal> to reset all the counters shown in the <structname>pg_stat_wal</structname> view or <literal>recovery_prefetch</literal> to reset all the counters shown in the <structname>pg_stat_recovery_prefetch</structname> view. 《マッチ度[74.888559]》引数に応じて、クラスタ全体の統計情報カウンタの一部をゼロにリセットします。 引数にbgwriterを指定すると、pg_stat_bgwriterビューで示されるカウンタがすべてリセットされ、archiverを指定するとpg_stat_archiverビューで示されるカウンタがすべてリセットされ、walを指定するとpg_stat_walビューで示されるカウンタがすべてリセットされ、recovery_prefetchを指定するとpg_stat_recovery_prefetch ビュー示されるカウンタがすべてリセットされます。 《機械翻訳》引数に応じて、クラスタ全体の統計カウンタをいくつかリセットします。 引数はbgwriterで、pg_stat_bgwriterビューに表示されるすべてのカウンタをリセットします。 archiverで、pg_stat_archiverビューに表示されるすべてのカウンタをリセットします。 ioで、pg_stat_ioビューに表示されるすべてのカウンタをリセットします。 walで、pg_stat_walビューに表示されるすべてのカウンタをリセットします。 recovery_prefetchで、pg_stat_recovery_prefetchビューに表示されるすべてのカウンタをリセットします。

This function is restricted to superusers by default, but other users can be granted EXECUTE to run the function. この関数はデフォルトでスーパーユーザに限定されていますが、関数を実行できるように他のユーザにEXECUTE権限を付与できます。

pg_stat_reset_single_table_counters ( oid ) → void

Resets statistics for a single table or index in the current database or shared across all databases in the cluster to zero. 現在のデータベース内にある、ひとつのテーブルまたはインデックス、あるいはクラスタ内のすべてのデータベースで共有されている統計情報をゼロにリセットします。

This function is restricted to superusers by default, but other users can be granted EXECUTE to run the function. この関数はデフォルトでスーパーユーザに限定されていますが、関数を実行できるように他のユーザにEXECUTE権限を付与できます。

pg_stat_reset_single_function_counters ( oid ) → void

Resets statistics for a single function in the current database to zero. 現在のデータベース内にある、ひとつの関数の統計情報をゼロにリセットします。

This function is restricted to superusers by default, but other users can be granted EXECUTE to run the function. この関数はデフォルトでスーパーユーザに限定されていますが、関数を実行できるように他のユーザにEXECUTE権限を付与できます。

pg_stat_reset_slru ( text ) → void

Resets statistics to zero for a single SLRU cache, or for all SLRUs in the cluster. If the argument is NULL, all counters shown in the <structname>pg_stat_slru</structname> view for all SLRU caches are reset. The argument can be one of <literal>CommitTs</literal>, <literal>MultiXactMember</literal>, <literal>MultiXactOffset</literal>, <literal>Notify</literal>, <literal>Serial</literal>, <literal>Subtrans</literal>, or <literal>Xact</literal> to reset the counters for only that entry. If the argument is <literal>other</literal> (or indeed, any unrecognized name), then the counters for all other SLRU caches, such as extension-defined caches, are reset. ひとつのSLRUキャッシュ、またはクラスタ内のすべてのSLRUの統計情報をゼロにリセットします。 引数がNULLであれば、pg_stat_slruビューで示されているすべてのSLRUキャッシュに対するカウンタがリセットされます。 引数は、そのエントリのみに対応するカウンタをリセットするようCommitTsMultiXactMemberMultiXactOffsetNotifySerialSubtransXactの1つを指定できます。 引数がother(実際のところは、認められていない名前であれば何でも)であれば、拡張が定義したキャッシュのような、それ以外のSLRUキャッシュに対するカウンタがリセットされます。

This function is restricted to superusers by default, but other users can be granted EXECUTE to run the function. この関数はデフォルトでスーパーユーザに限定されていますが、関数を実行できるように他のユーザにEXECUTE権限を付与できます。

pg_stat_reset_replication_slot ( text ) → void

Resets statistics of the replication slot defined by the argument. If the argument is <literal>NULL</literal>, resets statistics for all the replication slots. 引数で定義されたレプリケーションスロットの統計情報をリセットします。 引数がNULLの場合、すべてのレプリケーションスロットの統計情報をリセットします。

This function is restricted to superusers by default, but other users can be granted EXECUTE to run the function. この関数はデフォルトでスーパーユーザに限定されていますが、関数を実行できるように他のユーザにEXECUTE権限を付与できます。

pg_stat_reset_subscription_stats ( oid ) → void

Resets statistics for a single subscription shown in the <structname>pg_stat_subscription_stats</structname> view to zero. If the argument is <literal>NULL</literal>, reset statistics for all subscriptions. pg_stat_subscription_statsビューに表示されている単一サブスクリプションの統計をゼロにリセットします。 引数がNULLの場合は、すべてのサブスクリプションの統計をリセットします。

This function is restricted to superusers by default, but other users can be granted EXECUTE to run the function. この関数はデフォルトでスーパーユーザに限定されていますが、関数を実行できるように他のユーザにEXECUTE権限を付与できます。


警告

Using <function>pg_stat_reset()</function> also resets counters that autovacuum uses to determine when to trigger a vacuum or an analyze. Resetting these counters can cause autovacuum to not perform necessary work, which can cause problems such as table bloat or out-dated table statistics. A database-wide <command>ANALYZE</command> is recommended after the statistics have been reset. pg_stat_reset()を使用すると、自動バキュームがバキュームまたはANALYZEを実行するタイミングを決定するために使用するカウンタもリセットされます。 これらのカウンタをリセットすると、自動バキュームが必要な作業を実行できなくなり、テーブルの膨張や期限切れのテーブル統計情報などの問題が発生する可能性があります。 統計情報がリセットになった後にデータベース全体でANALYZEを実行することをお勧めします。

<function>pg_stat_get_activity</function>, the underlying function of the <structname>pg_stat_activity</structname> view, returns a set of records containing all the available information about each backend process. Sometimes it may be more convenient to obtain just a subset of this information. In such cases, another set of per-backend statistics access functions can be used; these are shown in <xref linkend="monitoring-stats-backend-funcs-table"/>. These access functions use the session's backend ID number, which is a small positive integer that is distinct from the backend ID of any concurrent session, although a session's ID can be recycled as soon as it exits. The backend ID is used, among other things, to identify the session's temporary schema if it has one. The function <function>pg_stat_get_backend_idset</function> provides a convenient way to list all the active backends' ID numbers for invoking these functions. For example, to show the <acronym>PID</acronym>s and current queries of all backends: 《マッチ度[60.648918]》pg_stat_activityビューの基礎となるpg_stat_get_activity関数は、各バックエンドプロセスに関して利用可能な情報をすべて含むレコード集合を返します。 この情報の一部のみを入手することがより簡便である場合があるかもしれません。 このような場合、表 28.36に示す、古めのバックエンド単位の統計情報アクセス関数を使用することができます。 これらのアクセス関数は、1から現在活動中のバックエンドの個数までの値を取る、バックエンドID番号を使用します。 pg_stat_get_backend_idset関数は、これらの関数を呼び出すために、活動中のバックエンド毎に1行を生成する簡便な方法を提供します。 例えば以下はすべてのバックエンドについてPIDと現在の問い合わせを示します。 《機械翻訳》pg_stat_activityは、pg_stat_activityビューの基本的な関数で、各バックエンドプロセスに関するすべての情報を含むレコードのセットを返します。 この情報のサブセットだけを取得した方が便利な場合もあります。 このような場合、別のバックエンドごとの統計情報アクセス関数を使用できます。 これらの関数は表 28.36に示されています。 これらのアクセス関数は、セッションのバックエンドID番号を使用します。 これは、バックエンドIDが同時に実行されているセッションのIDとは異なる小さな正の整数です。 ただし、セッションのIDは、セッションが終了すると再利用できます。 バックエンドIDは、特に、セッションが持つ場合には、セッションの一時的なスキーマを識別するために使用されます。 関数pg_stat_get_backend_idsetは、これらの関数を呼び出すために、すべてのアクティブなバックエンドのID番号を一覧表示する便利な方法を提供します。 たとえば、すべてのバックエンドのPIDと現在の問い合わせを表示するには、次のようにします。

SELECT pg_stat_get_backend_pid(backendid) AS pid,
       pg_stat_get_backend_activity(backendid) AS query
FROM pg_stat_get_backend_idset() AS backendid;

表28.36 バックエンド単位の統計情報関数

<title>Per-Backend Statistics Functions</title>

Function 関数

Description 説明

pg_stat_get_backend_activity ( integer ) → text

Returns the text of this backend's most recent query. バックエンドが最後に行った問い合わせテキストを返します。

pg_stat_get_backend_activity_start ( integer ) → timestamp with time zone

Returns the time when the backend's most recent query was started. バックエンドの最後の問い合わせが開始された時刻を返します。

pg_stat_get_backend_client_addr ( integer ) → inet

Returns the IP address of the client connected to this backend. バックエンドに接続したクライアントのIPアドレスを返します。

pg_stat_get_backend_client_port ( integer ) → integer

Returns the TCP port number that the client is using for communication. クライアントが通信に使用しているTCPポート番号を返します。

pg_stat_get_backend_dbid ( integer ) → oid

Returns the OID of the database this backend is connected to. バックエンドが接続するデータベースのOIDを返します。

pg_stat_get_backend_idset () → setof integer

Returns the set of currently active backend ID numbers. 《機械翻訳》現在アクティブなバックエンド ID 番号のセットを返します。

pg_stat_get_backend_pid ( integer ) → integer

Returns the process ID of this backend. バックエンドのプロセスIDを返します。

pg_stat_get_backend_start ( integer ) → timestamp with time zone

Returns the time when this process was started. プロセスが開始された時刻を返します。

pg_stat_get_backend_subxact ( integer ) → record

Returns a record of information about the subtransactions of the backend with the specified ID. The fields returned are <parameter>subxact_count</parameter>, which is the number of subtransactions in the backend's subtransaction cache, and <parameter>subxact_overflow</parameter>, which indicates whether the backend's subtransaction cache is overflowed or not. 《機械翻訳》指定された ID を持つバックエンドのサブトランザクションの情報を含むレコードを返します。 返されるフィールドは、バックエンドのサブトランザクション・キャッシュ内のサブトランザクション数を示す subxact_count と、バックエンドのサブトランザクション・キャッシュがオーバーフローしているかどうかを示す subxact_overflow です。

pg_stat_get_backend_userid ( integer ) → oid

Returns the OID of the user logged into this backend. バックエンドにログインしたユーザのOIDを返します。

pg_stat_get_backend_wait_event ( integer ) → text

Returns the wait event name if this backend is currently waiting, otherwise NULL. See <xref linkend="wait-event-activity-table"/> through <xref linkend="wait-event-timeout-table"/>. バックエンドが現在待機中であれば、待機イベント名を、さもなくばNULLを返します。 詳細は表 28.5から表 28.13までを参照してください。

pg_stat_get_backend_wait_event_type ( integer ) → text

Returns the wait event type name if this backend is currently waiting, otherwise NULL. See <xref linkend="wait-event-table"/> for details. バックエンドが現在待機中であれば、待機イベント型名を、さもなくばNULLを返します。 詳細については表 28.4を参照してください。

pg_stat_get_backend_xact_start ( integer ) → timestamp with time zone

Returns the time when the backend's current transaction was started. バックエンドの現在のトランザクションが開始された時刻を返します。