ClickHouse dictionaries
Dictionaries in ClickHouse are key-value data stores that are fully or partially loaded to the ClickHouse server memory.
Dictionary data is accessed using a set of functions
The main advantage of dictionaries is that they are faster compared to JOIN operations. Dictionaries are useful when you have to frequently access reference lists to get a set of values from a key.
Dictionaries use ClickHouse internal dictionaries
Internal dictionaries
Managed Service for ClickHouse contains a built-in geobase dictionary and a set of functions to work with it. This dictionary allows you to:
- Get the name of a region in the required language by the region ID.
- Get the ID of a city, region, state/province, country, and continent by the region ID.
- Check whether one region is part of another.
- Get a chain of parent regions.
You can learn more about the built-in dictionary features in the ClickHouse documentation