Open-Source Wikis

/

ClickHouse

/

Reference

/

Data models

clickhouse/clickhouse

Data models

This page is a quick reference for what data shapes ClickHouse understands. For the implementation, see Data types and columns.

Type families

Numbers

Type Width Signed
Int8, Int16, Int32, Int64, Int128, Int256 1 / 2 / 4 / 8 / 16 / 32 bytes yes
UInt8, UInt16, UInt32, UInt64, UInt128, UInt256 same no
Float32, Float64 4 / 8 bytes n/a
BFloat16 2 bytes n/a (vector-friendly)
Decimal(P, S) P ≤ 76 yes
Bool 1 byte (alias of UInt8 with display)

Strings and binary

  • String — variable-length bytes.
  • FixedString(N) — fixed-length bytes.

Date and time

Type Range Resolution
Date 1970-01-01 to 2149-06-06 day
Date32 1900-01-01 to 2299-12-31 day
DateTime 1970 to 2106 second
DateTime64(P, [TZ]) 1900 to 2299 up to nanosecond (P up to 9)
Time 24-hour offset second
Time64(P) same sub-second
Interval{Year,Month,Week,Day,Hour,Minute,Second,...} not stored as columns; produced by INTERVAL literals

Composite

  • Array(T) — variable-length.
  • Tuple(T1, T2, ...) — heterogeneous fixed-length tuple. Optionally with field names: Tuple(a UInt32, b String).
  • Map(K, V) — keyed map; under the hood it is Array(Tuple(K, V)).
  • Nested(c1 T1, c2 T2, ...) — sugar for "an array of tuples", flattens into multiple Array(T_i) subcolumns.

Modifiers

  • Nullable(T) — adds a NULL bit per row.
  • LowCardinality(T) — dictionary-encoded T (typically String).
  • Variant(T1, T2, ...) — sum type that holds one of the listed alternatives per row.
  • Dynamic — variant of run-time-discovered types.

Specials

  • UUID.
  • IPv4, IPv6.
  • Enum8, Enum16 — string ↔ small integer.
  • Object('json') / JSON — schemaless JSON column with on-the-fly subcolumn discovery.
  • AggregateFunction(name, args) — partial state of an aggregate.
  • SimpleAggregateFunction(name, args) — for additive aggregates with trivial state.
  • Geo types: Point, Ring, LineString, MultiLineString, Polygon, MultiPolygon.
  • BSONUUID, BSONOID — BSON wire-format types when reading BSON streams.

Storage / table engines

The engine catalogue (subdirectory in parentheses):

MergeTree family

Engine Use
MergeTree Default analytical engine.
ReplacingMergeTree Deduplicate by sort key during merges.
SummingMergeTree Sum measures during merges.
AggregatingMergeTree Merge *State aggregate columns.
CollapsingMergeTree, VersionedCollapsingMergeTree Cancel pairs of "+1"/"-1" rows.
GraphiteMergeTree Graphite metric rollups.
Replicated*MergeTree All of the above with Keeper-coordinated replication.

See Storage engine, MergeTree, Replicated MergeTree.

Special-purpose engines

Distributed, Memory, Buffer, Set, Join, URL, S3, HDFS, AzureBlobStorage, Iceberg, DeltaLake, Hudi, Hive, View, MaterializedView, WindowView, Dictionary, MergeTree-with-Streaming variants (Kafka, RabbitMQ, NATS, S3Queue, …), MaterializedMySQL, MaterializedPostgreSQL, Replicated (databases), External*, Null, File, EmbeddedRocksDB, Merge (proxy), Generate, MongoDB, MySQL, PostgreSQL, Redis, SQLite, MaterializedView, MaterializedMySQL, Live (deprecated).

See Other engines.

System tables

Selected system tables:

Table Contents
system.databases All databases.
system.tables All tables (incl. system, dictionary, view).
system.columns Columns of all tables.
system.parts, system.parts_columns, system.detached_parts MergeTree parts and their columns.
system.replicas, system.replication_queue, system.replicated_fetches Replication state.
system.merges, system.mutations, system.moves In-progress engine work.
system.processes Running queries.
system.query_log, system.query_thread_log, system.query_views_log, system.query_metric_log Historical queries.
system.text_log, system.crash_log, system.error_log Logs.
system.metric_log, system.asynchronous_metric_log, system.latency_log Metric snapshots.
system.trace_log Sampling profiler.
system.session_log Logins.
system.part_log Per-part lifecycle events.
system.zookeeper_log, system.zookeeper Keeper state.
system.distributed_ddl_queue, system.distribution_queue Cluster work.
system.dictionaries, system.functions, system.aggregate_function_combinators, system.formats, system.codecs, system.data_type_families Engine catalogue.
system.users, system.roles, system.grants, system.role_grants, system.row_policies, system.quotas, system.quota_usage, system.settings_profiles, system.settings_constraints Access entities.
system.settings, system.server_settings, system.merge_tree_settings, system.compatibility, system.formats, system.licenses, system.timezones Static catalogue.
system.events, system.metrics, system.asynchronous_metrics Counters and gauges.
system.asynchronous_inserts, system.asynchronous_insert_log Async insert queue.
system.s3_queue, system.s3_queue_log Streaming queue tables.
system.backups, system.backup_log Backup state.
system.iceberg_history, system.iceberg_metadata_log Iceberg-specific.
system.filesystem_cache, system.filesystem_cache_log Disk cache.
system.replicated_merge_tree_settings Per-table runtime settings.
system.dashboards Built-in /dashboard SQL definitions.

The full list (~250 tables) is registered in src/Storages/System/StorageSystem*.cpp and friends.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Data models – ClickHouse wiki | Factory