Unlock this content

Enter your email to unlock this content for free

By continuing, you agree to our Terms of Service and Privacy Notice, and to receive occasional marketing emails.

Dictionaries

TL;DR

Dictionaries in ClickHouse provide fast lookups for reference data, avoiding expensive JOINs. They're ideal for static or slowly changing data that you need to look up frequently. Use dictionaries for user information, country codes, product catalogs, and other reference data. Dictionaries are loaded into memory and provide very fast lookups, making them perfect for replacing JOINs in hot query paths.

Dictionaries are one of the most effective ways to avoid expensive JOINs in ClickHouse. They provide fast in-memory lookups for reference data, making queries much faster than JOINs.


What are Dictionaries?

Dictionaries in ClickHouse are in-memory data structures that provide fast key-value lookups. They're loaded from a source (table, file, HTTP endpoint) and kept in memory for fast access.

Key characteristics:

  • In-memory: Loaded into memory for fast access
  • Key-value lookups: Fast lookups by primary key
  • Multiple layouts: Different storage layouts for different use cases

Tinybird is not affiliated with, associated with, or sponsored by ClickHouse, Inc. ClickHouse® is a registered trademark of ClickHouse, Inc.

Dictionaries | ClickHouse for Developers