Back to Clickhouse

system.dictionaries

docs/en/operations/system-tables/dictionaries.md

26.4.1.1-new1.5 KB
Original Source

import SystemTableCloud from '@site/docs/_snippets/_system_table_cloud.md';

Contains information about dictionaries.

Columns:

<!--AUTOGENERATED_START--> <!--AUTOGENERATED_END-->

Example

Configure the dictionary:

sql
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';

Make sure that the dictionary is loaded.

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