

# aurora\$1stat\$1memctx\$1usage
<a name="aurora_stat_memctx_usage"></a>

各 PostgreSQL プロセスのメモリコンテキスト使用状況を報告します。

## 構文
<a name="aurora_stat_memctx_usage-syntax"></a>

```
aurora_stat_memctx_usage()
```

## 引数
<a name="aurora_stat_memctx_usage-arguments"></a>

なし

## 戻り型
<a name="aurora_stat_memctx_usage-return-type"></a>

次の列を含む SETOF レコード。
+ `pid` - プロセスの ID。
+ `name` – メモリコンテキストの名前。
+ `allocated` — 基になるメモリサブシステムからメモリコンテキストによって取得されたバイト数。
+ `used` — メモリコンテキストのクライアントにコミットされたバイト数。
+ `instances` — このタイプの現在存在するコンテキストの数。

## 使用に関する注意事項
<a name="aurora_stat_memctx_usage-usage-notes"></a>

この関数は、各 PostgreSQL プロセスのメモリコンテキスト使用状況を表示します。一部のプロセスには `anonymous` というラベルが付いています。プロセスには制限付きのキーワードが含まれているため、公開されません。

この関数は、次の Aurora PostgreSQL バージョン以降で使用できます。
+ 15.3 以降の 15 バージョン
+ 14.8 以降の 14 バージョン
+ 13.11 以降の 13 バージョン
+ 12.15 以降の 12 バージョン
+ 11.20 以降の 11 バージョン

## 例
<a name="aurora_stat_memctx_usage-examples"></a>

次の例は、`aurora_stat_memctx_usage` 関数呼び出しの結果を示しています。

```
=> SELECT * 
     FROM aurora_stat_memctx_usage();
  
    pid| name                            | allocated |   used  | instances 
-------+---------------------------------+-----------+---------+-----------
123864 | Miscellaneous                   |     19520 |   15064 |         3 
123864 | Aurora File Context             |      8192 |     616 |         1 
123864 | Aurora WAL Context              |      8192 |     296 |         1 
123864 | CacheMemoryContext              |    524288 |  422600 |         1 
123864 | Catalog tuple context           |     16384 |   13736 |         1 
123864 | ExecutorState                   |     32832 |   28304 |         1 
123864 | ExprContext                     |      8192 |    1720 |         1 
123864 | GWAL record construction        |      1024 |     832 |         1 
123864 | MdSmgr                          |      8192 |     296 |         1 
123864 | MessageContext                  |    532480 |  353832 |         1 
123864 | PortalHeapMemory                |      1024 |     488 |         1 
123864 | PortalMemory                    |      8192 |     576 |         1 
123864 | printtup                        |      8192 |     296 |         1 
123864 | RelCache hash table entries     |      8192 |    8152 |         1 
123864 | RowDescriptionContext           |      8192 |    1344 |         1 
123864 | smgr relation context           |      8192 |     296 |         1 
123864 | Table function arguments        |      8192 |     352 |         1 
123864 | TopTransactionContext           |      8192 |     632 |         1 
123864 | TransactionAbortContext         |     32768 |     296 |         1 
123864 | WAL record construction         |     50216 |   43904 |         1 
123864 | hash table                      |     65536 |   52744 |         6 
123864 | Relation metadata               |    191488 |  124240 |        87 
104992 | Miscellaneous                   |      9280 |    7728 |         3 
104992 | Aurora File Context             |      8192 |     376 |         1 
104992 | Aurora WAL Context              |      8192 |     296 |         1 
104992 ||Autovacuum Launcher             |      8192 |     296 |         1 
104992 | Autovacuum database list        |     16384 |     744 |         2 
104992 | CacheMemoryContext              |    262144 |  140288 |         1 
104992 | Catalog tuple context           |      8192 |     296 |         1 
104992 | GWAL record construction        |      1024 |     832 |         1 
104992 | MdSmgr                          |      8192 |     296 |         1 
104992 | PortalMemory                    |      8192 |     296 |         1 
104992 | RelCache hash table entries     |      8192 |     296 |         1 
104992 | smgr relation context           |      8192 |     296 |         1 
104992 | Autovacuum start worker (tmp)   |      8192 |     296 |         1 
104992 | TopTransactionContext           |     16384 |     592 |         2 
104992 | TransactionAbortContext         |     32768 |     296 |         1 
104992 | WAL record construction         |     50216 |   43904 |         1 
104992 | hash table                      |     49152 |   34024 |         4 
(39 rows)
```

一部の制限付きキーワードは非表示になり、出力は次のようになります。

```
postgres=>SELECT * 
     FROM aurora_stat_memctx_usage();
   
    pid| name                            | allocated |   used  | instances 
-------+---------------------------------+-----------+---------+-----------
  5482 | anonymous                       |      8192 |     456 |         1 
  5482 | anonymous                       |      8192 |     296 |         1
```