1–33). Queries within a family (a, b, c, …) share the same join graph but differ in their selection predicates.
References
- How Good Are Query Optimizers, Really? (Leis et al., VLDB 2015)
- Join Order Benchmark repository
Creating the tables
The JOB dataset is a snapshot of IMDb with 21 tables. The table definitions are available ininit_cloud.sql in the ClickHouse repository.
Each table uses the MergeTree engine sorted by its primary key column id, mirroring the original PostgreSQL schema where every table declares id integer NOT NULL PRIMARY KEY. Nullable PostgreSQL columns map to Nullable(...) types.
Create the tables:
Loading the data
The data comes from the original IMDb snapshot used by JOB, distributed as one CSV file per table (aka_name.csv, title.csv, …).
These CSVs use PostgreSQL COPY semantics with ESCAPE '\': a backslash escapes the quote character only inside a quoted field, while outside quotes a backslash is a literal character.
ClickHouse expects RFC 4180 CSV (doubled quotes, no backslash escaping), so the files must be re-encoded first.
convert_csv.py performs that re-encoding.
It reads the original CSV on stdin and writes standard CSV on stdout, doubling embedded quotes and preserving empty unquoted fields (which ClickHouse maps to NULL for Nullable columns).
To build the tables from the original CSVs:
- Create the tables (see above).
- Download the IMDb data set as an
imdb.tgzfile, following the instructions in the Join Order Benchmark repository. - Convert and import the data:
clickhouse client --database job --query "SELECT * FROM title ORDER BY id FORMAT Parquet" > title.parquet.
Detailed table sizes:
(Compressed sizes in ClickHouse are taken from
system.tables.total_bytes and based on the above table definitions.)
Queries
The 113 JOB queries can be found here in the ClickHouse repository. The settings used to run them are insettings.json.
See the README for known issues and notes on specific queries.
The queries reference the tables by name, so run them against the job database (for example, with clickhouse client --database job).
An example query (1a):