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

> Dictionaryに関する情報を含むシステムテーブル

# system.dictionaries

<Info>
  **ClickHouse Cloud でのクエリ**

  このシステムテーブルのデータは、ClickHouse Cloud の各ノードにローカルに保持されています。したがって、すべてのデータを完全に把握するには、`clusterAllReplicas` 関数を使用する必要があります。詳細については、[こちら](/ja/reference/system-tables/overview#system-tables-in-clickhouse-cloud)を参照してください。
</Info>

<div id="description">
  ## 説明
</div>

[Dictionary](/ja/reference/statements/create/dictionary) に関する情報が含まれます。

<div id="columns">
  ## カラム
</div>

* `database` ([String](/ja/reference/data-types/index)) — DDL クエリによって作成された Dictionary が含まれるデータベースの名前。その他の Dictionary では空文字列です。
* `name` ([String](/ja/reference/data-types/index)) — Dictionary 名。
* `uuid` ([UUID](/ja/reference/data-types/index)) — Dictionary UUID。
* `status` ([Enum8('NOT\_LOADED' = 0, 'LOADED' = 1, 'FAILED' = 2, 'LOADING' = 3, 'FAILED\_AND\_RELOADING' = 4, 'LOADED\_AND\_RELOADING' = 5, 'NOT\_EXIST' = 6)](/ja/reference/data-types/index)) — Dictionary の status。設定可能な値:
  * **NOT\_LOADED** — 使用されていないため、Dictionary は読み込まれていません
  * **LOADED** — Dictionary は正常に読み込まれました
  * **FAILED** — error のため Dictionary を読み込めませんでした
  * **LOADING** — Dictionary は現在読み込み中です
  * **LOADED\_AND\_RELOADING** — Dictionary は正常に読み込まれており、
  * **and is being reloaded right now (frequent reasons: SYSTEM RELOAD DICTIONARY query** — 現在再読み込み中です (よくある理由: SYSTEM RELOAD DICTIONARY クエリ、
  * **timeout** — timeout、
  * **dictionary config has changed)** — Dictionary の設定が変更された、など)
  * **FAILED\_AND\_RELOADING** — error のため Dictionary を読み込めず、現在再読み込み中です。
* `origin` ([String](/ja/reference/data-types/index)) — Dictionary を記述した設定ファイルへのパス。
* `type` ([String](/ja/reference/data-types/index)) — Dictionary の割り当てタイプ。Dictionaries のメモリ内保存を参照してください。
* `key.names` ([Array(String)](/ja/reference/data-types/index)) — Dictionary が提供するキー名の Array。
* `key.types` ([Array(String)](/ja/reference/data-types/index)) — Dictionary が提供する対応するキー型の Array。
* `attribute.names` ([Array(String)](/ja/reference/data-types/index)) — Dictionary が提供する属性名の Array。
* `attribute.types` ([Array(String)](/ja/reference/data-types/index)) — Dictionary が提供する対応する属性型の Array。
* `bytes_allocated` ([UInt64](/ja/reference/data-types/index)) — Dictionary に割り当てられた RAM の量。
* `hierarchical_index_bytes_allocated` ([UInt64](/ja/reference/data-types/index)) — 階層索引に割り当てられた RAM の量。
* `query_count` ([UInt64](/ja/reference/data-types/index)) — Dictionary の読み込み後、または最後に正常に再起動されて以降のクエリ数。
* `hit_rate` ([Float64](/ja/reference/data-types/index)) — cache Dictionary の場合、値が cache に存在した使用の割合です。
* `found_rate` ([Float64](/ja/reference/data-types/index)) — 値が見つかった使用の割合です。
* `element_count` ([UInt64](/ja/reference/data-types/index)) — Dictionary に格納されている項目数。
* `load_factor` ([Float64](/ja/reference/data-types/index)) — Dictionary の充填率 (ハッシュ Dictionary の場合は hash table の充填率) 。
* `source` ([String](/ja/reference/data-types/index)) — Dictionary のデータソースを説明するテキスト。
* `lifetime_min` ([UInt64](/ja/reference/data-types/index)) — メモリ内の Dictionary の最小有効期間。この時間を過ぎると ClickHouse は Dictionary の再読み込みを試みます (`invalidate_query` が設定されている場合は、変更があったときのみ) 。単位は秒です。
* `lifetime_max` ([UInt64](/ja/reference/data-types/index)) — メモリ内の Dictionary の最大有効期間。この時間を過ぎると ClickHouse は Dictionary の再読み込みを試みます (`invalidate_query` が設定されている場合は、変更があったときのみ) 。単位は秒です。
* `loading_start_time` ([DateTime](/ja/reference/data-types/index)) — Dictionary の読み込み開始時刻。
* `last_successful_update_time` ([DateTime](/ja/reference/data-types/index)) — Dictionary の読み込みまたは更新の終了時刻。Dictionary ソースの問題の監視や、原因調査に役立ちます。
* `error_count` ([UInt64](/ja/reference/data-types/index)) — 最後に正常に読み込まれて以降の error 数。Dictionary ソースの問題の監視や、原因調査に役立ちます。
* `loading_duration` ([Float32](/ja/reference/data-types/index)) — Dictionary の読み込み時間。
* `last_exception` ([String](/ja/reference/data-types/index)) — Dictionary を作成できなかった場合に、Dictionary の作成または再読み込み時に発生する error のテキスト。
* `comment` ([String](/ja/reference/data-types/index)) — Dictionary の comment のテキスト。

<div id="example">
  ## 例
</div>

Dictionary を設定します。

```sql theme={null}
CREATE DICTIONARY dictionary_with_comment
(
    id UInt64,
    value String
)
PRIMARY KEY id
SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() TABLE 'source_table'))
LAYOUT(FLAT())
LIFETIME(MIN 0 MAX 1000)
COMMENT 'The temporary dictionary';
```

Dictionary が読み込まれていることを確認してください。

```sql theme={null}
SELECT * FROM system.dictionaries LIMIT 1 FORMAT Vertical;
```

```text theme={null}
Row 1:
──────
database:                    default
name:                        dictionary_with_comment
uuid:                        4654d460-0d03-433a-8654-d4600d03d33a
status:                      NOT_LOADED
origin:                      4654d460-0d03-433a-8654-d4600d03d33a
type:
key.names:                   ['id']
key.types:                   ['UInt64']
attribute.names:             ['value']
attribute.types:             ['String']
bytes_allocated:             0
query_count:                 0
hit_rate:                    0
found_rate:                  0
element_count:               0
load_factor:                 0
source:
lifetime_min:                0
lifetime_max:                0
loading_start_time:          1970-01-01 00:00:00
last_successful_update_time: 1970-01-01 00:00:00
loading_duration:            0
last_exception:
comment:                     The temporary dictionary
```
