Skip to content
ClickHouse Docs
ClickHouse DocsClickHouse Docs

system.dictionaries

説明

Dictionary に関する情報が含まれます。

カラム

  • database (String) — DDLクエリで作成されたDictionaryを含むデータベース名。その他のDictionaryでは空文字列です。
  • name (String) — Dictionary名。
  • uuid (UUID) — DictionaryのUUID。
  • status (Enum8('NOT_LOADED' = 0, 'LOADED' = 1, 'FAILED' = 2, 'LOADING' = 3, 'FAILED_AND_RELOADING' = 4, 'LOADED_AND_RELOADING' = 5, 'NOT_EXIST' = 6)) — Dictionaryのステータス。設定可能な値: NOT_LOADED — Dictionaryが現在メモリにロードされていない、LOADED — Dictionaryが正常にロードされた、FAILED — エラーによりDictionaryをロードできない、LOADING — Dictionaryを現在ロード中、LOADED_AND_RELOADING — Dictionaryが正常にロードされており、現在再ロード中 (一般的な理由: SYSTEM RELOAD DICTIONARYクエリ、timeout、Dictionaryの設定変更) 、FAILED_AND_RELOADING — エラーによりDictionaryをロードできず、現在ロード中。
  • origin (String) — Dictionaryを定義する設定ファイルのパス。
  • type (String) — Dictionaryの割り当てタイプ。Dictionaryをメモリに格納します。
  • key.names (Array(String)) — Dictionaryで指定されたキー名のArray。
  • key.types (Array(String)) — Dictionaryで指定された対応するキー型のArray。
  • attribute.names (Array(String)) — Dictionaryで指定されたattribute名のArray。
  • attribute.types (Array(String)) — Dictionaryで指定された対応するattribute型のArray。
  • bytes_allocated (UInt64) — Dictionaryに割り当てられたRAMの量。
  • hierarchical_index_bytes_allocated (UInt64) — 階層索引に割り当てられたRAMの量。
  • query_count (UInt64) — Dictionaryがロードされてから、または最後に正常に再起動されてからのクエリ数。
  • hit_rate (Float64) — cache Dictionaryの場合、値がcache内に存在した使用の割合。
  • found_rate (Float64) — 値が見つかった使用の割合。
  • element_count (UInt64) — Dictionaryに格納されている項目数。
  • load_factor (Float64) — Dictionaryの使用率 (hashed Dictionaryの場合は、hash tableの使用率) 。
  • source (String) — Dictionaryのデータソースを説明するテキスト。
  • lifetime_min (UInt64) — メモリ内のDictionaryの最小lifetime。この時間が経過すると、ClickHouseはDictionaryの再ロードを試みます (invalidate_queryが設定されている場合は、変更されているときのみ) 。Seconds単位で設定します。
  • lifetime_max (UInt64) — メモリ内のDictionaryの最大lifetime。この時間が経過すると、ClickHouseはDictionaryの再ロードを試みます (invalidate_queryが設定されている場合は、変更されているときのみ) 。Seconds単位で設定します。
  • loading_start_time (DateTime) — Dictionaryのロード開始時刻。
  • last_successful_update_time (DateTime) — Dictionaryのロードまたは更新の終了時刻。Dictionary ソースに関する問題の監視や原因の調査に役立ちます。
  • error_count (UInt64) — 最後に正常にロードされてからのエラー数。Dictionary ソースに関する問題の監視や原因の調査に役立ちます。
  • loading_duration (Float32) — Dictionaryのロード時間。
  • last_exception (String) — Dictionaryを作成できなかった場合に、作成または再ロード時に発生したエラーのテキスト。
  • comment (String) — Dictionaryに付加されたコメントのテキスト。

Dictionary を設定します。

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 が読み込まれていることを確認してください。

SELECT * FROM system.dictionaries LIMIT 1 FORMAT Vertical;
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
Navigation