

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# aurora\_stat\_logical\_wal\_cache
<a name="aurora_stat_logical_wal_cache"></a>

顯示每個插槽的邏輯預寫日誌 (WAL) 快取使用量。

## 語法
<a name="aurora_stat_logical_wal_cache-syntax"></a>



```
SELECT * FROM aurora_stat_logical_wal_cache()
```

## 引數
<a name="aurora_stat_logical_wal_cache-arguments"></a>

無

## 傳回類型
<a name="aurora_stat_logical_wal_cache-return-type"></a>

SETOF 記錄，包含下列欄：
+ `name` - 複寫槽的名稱。
+ `active_pid` – walsender 程序的 ID。
+ `cache_hit` – 自上次重設以來的 WAL 快存命中總數。
+ `cache_miss` – 自上次重設以來的 WAL 快存未命中總數。
+ `blks_read` – WAL 快取讀取請求的總數。
+ `hit_rate` – WAL 快取命中率 (cache\_hit / blks\_read)。
+ `last_reset_timestamp` – 上次重設計數器的時間。

## 使用須知
<a name="aurora_stat_logical_wal_cache-usage-notes"></a>

此函數適用於下列 Aurora PostgreSQL 版本。
+ 15.2 版和所有更新版本
+ 14.7 及更新版本
+ 13.8 和更新版本
+ 12.12 和更新版本
+ 11.17 和更新版本

## 範例
<a name="aurora_stat_logical_wal_cache-examples"></a>

下列範例顯示了兩個只有一個作用中 `aurora_stat_logical_wal_cache` 函數的複寫槽。

```
=> SELECT * 
     FROM aurora_stat_logical_wal_cache();
    name    | active_pid | cache_hit | cache_miss | blks_read | hit_rate |     last_reset_timestamp
------------+------------+-----------+------------+-----------+----------+-------------------------------
 test_slot1 |      79183 |        24 |          0 |        24 | 100.00%  | 2022-08-05 17:39:56.830635+00
 test_slot2 |            |         1 |          0 |         1 | 100.00%  | 2022-08-05 17:34:04.036795+00
(2 rows)
```