> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-postgresql-tls-support.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# page_cache_* セッション設定

> page_cache_* の生成グループに含まれる ClickHouse のセッション設定。

export const VersionHistory = ({rows = []}) => {
  if (rows.length === 0) {
    return null;
  }
  const headers = ["バージョン", "デフォルト値", "コメント"];
  const border = "1px solid rgba(128, 128, 128, 0.3)";
  const cell = {
    border,
    padding: "0.25rem 0.5rem",
    textAlign: "start",
    verticalAlign: "top"
  };
  return <details className="not-prose" style={{
    border,
    borderRadius: "0.5rem",
    margin: "0.5rem 0",
    padding: "0.5rem 0.75rem",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <summary style={{
    cursor: "pointer",
    fontWeight: 600,
    opacity: 0.72
  }}>
        バージョン履歴
      </summary>
      <table style={{
    borderCollapse: "collapse",
    width: "100%",
    margin: "0.5rem 0 0"
  }}>
        <thead>
          <tr>
            {headers.map(header => <th key={header} style={{
    ...cell,
    fontWeight: 600,
    opacity: 0.72
  }}>
                {header}
              </th>)}
          </tr>
        </thead>
        <tbody>
          {rows.map((row, row_index) => <tr key={row.id ?? row_index}>
              {(row.items ?? []).map((item, item_index) => <td key={item_index} style={{
    ...cell,
    overflowWrap: "anywhere"
  }}>
                  {item?.label}
                </td>)}
            </tr>)}
        </tbody>
      </table>
    </details>;
};

export const SettingsInfoBlock = ({type, default_value, changeable_without_restart}) => {
  return <div className="not-prose" style={{
    display: "flex",
    flexWrap: "wrap",
    alignItems: "baseline",
    columnGap: "0.5rem",
    rowGap: "0.125rem",
    margin: "0.375rem 0",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <div style={{
    fontWeight: 600,
    opacity: 0.72
  }}>型</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{type}</div>
      <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>デフォルト値</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{default_value}</div>
      {changeable_without_restart && <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>
          再起動せずに変更可能
        </div>}
      {changeable_without_restart && <div style={{
    overflowWrap: "anywhere"
  }}>
          {changeable_without_restart}
        </div>}
    </div>;
};

これらの設定は [system.settings](/ja/reference/system-tables/settings) で確認でき、[ソースコード](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp) から自動生成されています。

<div id="page_cache_block_size">
  ## page\_cache\_block\_size
</div>

<SettingsInfoBlock type="UInt64" default_value="1048576" />

ユーザー空間ページキャッシュ に保存するファイル chunk のサイズ (バイト単位) です。cache を経由するすべての読み取りは、このサイズの倍数に切り上げられます。

この設定はクエリ単位で調整できますが、block サイズが異なる cache エントリは再利用できません。この設定を変更すると、実質的に cache 内の既存エントリは無効になります。

1 MiB のような大きな値は高スループットのクエリに適しており、64 KiB のような小さな値は低レイテンシのポイントクエリに適しています。

<div id="page_cache_inject_eviction">
  ## page\_cache\_inject\_eviction
</div>

<SettingsInfoBlock type="Bool" default_value="0" />

ユーザー空間ページキャッシュでは、ランダムに一部のページが無効化されることがあります。テスト用です。

<div id="page_cache_lookahead_blocks">
  ## page\_cache\_lookahead\_blocks
</div>

<SettingsInfoBlock type="UInt64" default_value="16" />

ユーザー空間のページキャッシュでキャッシュミスが発生した場合、後続の連続ブロックもキャッシュにないときは、基盤となるストレージから一度に最大でこの数まで読み込みます。各ブロックのサイズは `page_cache_block_size` バイトです。

値を大きくすると高スループットのクエリに適しており、低レイテンシのポイントクエリでは先読みを行わないほうが適しています。

<div id="page_cache_max_coalesced_bytes">
  ## page\_cache\_max\_coalesced\_bytes
</div>

<SettingsInfoBlock type="UInt64" default_value="16777216" />

`readBigAt` がユーザー空間ページキャッシュを拡充する際、連続するキャッシュミスは基盤となるストレージからの 1 回の読み取りに結合されます。この設定は、1 回の結合読み取りのサイズをバイト単位で制限します。より長いミスの連続は複数の読み取りに分割されます。これにより、並列コールド読み取り時の一時バッファの瞬間的なメモリ使用量が抑えられます。

値を大きくすると、オブジェクトストレージに対するコールドスキャン時の HTTP リクエスト数が減り、値を小さくするとピーク時の一時メモリ使用量が減ります。
