Skip to main content
Skip to main content

hashed dictionary layout types

hashed​

The dictionary is completely stored in memory in the form of a hash table. The dictionary can contain any number of elements with any identifiers. In practice, the number of keys can reach tens of millions of items.

The dictionary key has the UInt64 type.

All types of sources are supported. When updating, data (from a file or from a table) is read in its entirety.

Configuration example:

LAYOUT(HASHED())

Configuration example with settings:

LAYOUT(HASHED([SHARDS 1] [SHARD_LOAD_QUEUE_BACKLOG 10000] [MAX_LOAD_FACTOR 0.5]))

sparse_hashed​

Similar to hashed, but uses less memory in favor more CPU usage.

The dictionary key has the UInt64 type.

Configuration example:

LAYOUT(SPARSE_HASHED([SHARDS 1] [SHARD_LOAD_QUEUE_BACKLOG 10000] [MAX_LOAD_FACTOR 0.5]))

It is also possible to use shards for this type of dictionary, and again it is more important for sparse_hashed then for hashed, since sparse_hashed is slower.

complex_key_hashed​

This type of storage is for use with composite keys. Similar to hashed.

Configuration example:

LAYOUT(COMPLEX_KEY_HASHED([SHARDS 1] [SHARD_LOAD_QUEUE_BACKLOG 10000] [MAX_LOAD_FACTOR 0.5]))

complex_key_sparse_hashed​

This type of storage is for use with composite keys. Similar to sparse_hashed.

Configuration example:

LAYOUT(COMPLEX_KEY_SPARSE_HASHED([SHARDS 1] [SHARD_LOAD_QUEUE_BACKLOG 10000] [MAX_LOAD_FACTOR 0.5]))