Dictionary layout types
There are a variety of ways to store dictionaries in memory, each with CPU and RAM-usage trade-offs.Specify dictionary layout
You can configure a dictionary layout with theLAYOUT clause (for DDL) or the layout setting for configuration file definitions.
- DDL
- Configuration file
See also CREATE DICTIONARY for the full DDL syntax. Dictionaries without word
complex-key* in a layout have a key with UInt64 type, complex-key* dictionaries have a composite key (complex, with arbitrary types).
Numeric key example (column key_column has UInt64 type):
- DDL
- Configuration file
Composite key example (key has one element with String type):
- DDL
- Configuration file
Improve dictionary performance
There are several ways to improve dictionary performance:- Call the function for working with the dictionary after
GROUP BY. - Mark attributes to extract as injective.
An attribute is called injective if different keys correspond to different attribute values.
So when
GROUP BYuses a function that fetches an attribute value by the key, this function is automatically taken out ofGROUP BY.
- The dictionary being accessed could not be loaded.
- Error querying a
cacheddictionary.