pg_backend_memory_contexts
#
The view <structname>pg_backend_memory_contexts</structname> displays all
the memory contexts of the server process attached to the current session.
pg_backend_memory_contexts
ビューは、現在のセッションにアタッチされているサーバプロセスのすべてのメモリコンテキストを表示します。
<structname>pg_backend_memory_contexts</structname> contains one row
for each memory context.
pg_backend_memory_contexts
の各1行が各々のメモリコンテキストを格納します。
表53.5 pg_backend_memory_contexts
Columns
Column Type 列 型 Description 説明 |
---|
Name of the memory context メモリコンテキストの名前 |
Identification information of the memory context. This field is truncated at 1024 bytes メモリコンテキストの識別情報。このフィールドは1024バイトで切り捨てられる |
Type of the memory context 《マッチ度[61.538462]》メモリコンテキストの名前 《機械翻訳》メモリコンテキストのタイプ。 |
The 1-based level of the context in the memory context hierarchy. The
level of a context also shows the position of that context in the
<structfield>path</structfield> column.
《機械翻訳》レベル階層におけるコンテキストの1から始まるメモリコンテキスト。
コンテキストのレベルは、 |
Array of transient numerical identifiers to describe the memory
context hierarchy. The first element is for
<literal>TopMemoryContext</literal>, subsequent elements contain
intermediate parents and the final element contains the identifier for
the current context.
《機械翻訳》配列階層を記述する一時的な数値識別子のメモリコンテキスト。
最初の要素は |
Total bytes allocated for this memory context このメモリコンテキストで確保した合計バイト数 |
Total number of blocks allocated for this memory context このメモリコンテキストで確保した合計ブロック数 |
Free space in bytes バイト単位の空き領域 |
Total number of free chunks 空きチャンクの数 |
Used space in bytes バイト単位の使用領域 |
By default, the <structname>pg_backend_memory_contexts</structname> view can be
read only by superusers or roles with the privileges of the
<literal>pg_read_all_stats</literal> role.
デフォルトではpg_backend_memory_contexts
ビューはスーパーユーザか、pg_read_all_stats
ロールの権限を持つユーザのみが読み取り専用でアクセスできます。
Since memory contexts are created and destroyed during the running of a
query, the identifiers stored in the <structfield>path</structfield> column
can be unstable between multiple invocations of the view in the same query.
The example below demonstrates an effective usage of this column and
calculates the total number of bytes used by
<literal>CacheMemoryContext</literal> and all of its children:
《機械翻訳》メモリ・コンテキストは問い合わせの実行中に作成および破棄されるため、パス
カラムに格納された識別子は、同じ問い合わせのビューのマルチプル起動間で不安定になる可能性があります。
次の例は、このカラムの効果的な使用方法を示し、CacheMemoryContext
およびそのすべての子によって使用される合計バイト数を計算します。
WITH memory_contexts AS ( SELECT * FROM pg_backend_memory_contexts ) SELECT sum(c1.total_bytes) FROM memory_contexts c1, memory_contexts c2 WHERE c2.name = 'CacheMemoryContext' AND c1.path[c2.level] = c2.path[c2.level];
The <link linkend="queries-with">Common Table Expression</link> is used
to ensure the context IDs in the <structfield>path</structfield> column
match between both evaluations of the view.
《機械翻訳》共通テーブル式は、コンテキストの両方の評価の間でpath
カラムマッチのビューIDを保証するために使用されます。