Skip to main content
Similar to the Star Schema Benchmark (SSB), TPC-DS is based on TPC-H, but it took the opposite route, i.e. it expanded the number of joins needed by storing the data in a complex snowflake schema (24 instead of 8 tables). The data distribution is skewed (e.g. normal and Poisson distributions). It includes 99 reporting and ad-hoc queries with random substitutions. References

Data Generation and Import

First, checkout the TPC-DS repository and compile the data generator:
Then, generate the data. Parameter -scale specifies the scale factor.
Now create tables in ClickHouse. The table definitions are available in init.sql in the ClickHouse repository. The data can be imported as follows:
Then run the generated queries.

Queries

The 99 TPC-DS queries can be found here in the ClickHouse repository. To get SQL standard compatible behavior and expected results, apply the settings from settings.json. See the README for known issues and notes on specific queries. Correctness The results of the queries agree with the official results unless otherwise noted. There may be minor precision differences, which are permitted by the TPC-DS specification.

Performance benchmark

ClickHouse tracks TPC-DS query performance across every released version. You can explore run times for all 99 TPC-DS queries (scale factor 32) on the ClickHouse versions benchmark page to see how performance has evolved over time.
Last modified on August 10, 2026