Skip to content

pg_lake_benchmark

Provides ClickBench, TPC-H and TPC-DS data generation and benchmark queries for pg_lake, Iceberg and heap tables.

pg_lake · Provides ClickBench, TPC-H and TPC-DS data generation and benchmark queries for pg_lake, Iceberg and heap tables.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
2568pg_lake_benchmarkpg_lake3.7FEATApache-2.0C

PostgreSQL · 16, 17, 18, 19

Relationships
Requirespg_lake

Usage

Sources:

pg_lake_benchmark supplies ClickBench, TPC-H, and TPC-DS data/query drivers for comparing pg_lake, Iceberg, and ordinary PostgreSQL heap tables. It depends on pg_lake and is intended for controlled benchmark databases, because its generators create large schemas and data sets and its runners discard query results.

Core Workflow

Install the dependency and extension, then choose one benchmark and table type:

CREATE EXTENSION pg_lake;
CREATE EXTENSION pg_lake_benchmark;

SELECT lake_tpch.gen(
  location => 's3://my-benchmark/tpch',
  table_type => 'pg_lake',
  scale_factor => 0.01,
  iteration_count => 10
);

SELECT * FROM lake_tpch.queries();
\timing on
SELECT lake_tpch.run_query(1);

Use a dedicated object-store prefix and disposable database. Increasing iteration_count reduces peak memory during large TPC-H generation.

Benchmark APIs

  • lake_clickbench.create(table_type => ...) and lake_clickbench.load(): create and load the ClickBench table. The load reads an approximately 15 GB Parquet data set from S3.
  • lake_clickbench.show_query(id) and lake_clickbench.run_query(id): inspect or run one of 43 queries.
  • lake_tpch.gen(...), lake_tpch.queries(), and lake_tpch.run_query(id): generate and run the 22-query TPC-H suite.
  • lake_tpcds.gen(...), lake_tpcds.queries(), and lake_tpcds.run_query(id): generate and run the 99-query TPC-DS suite.
  • Supported table_type values are iceberg, pg_lake, and heap.

Caveats

The run functions execute a query and discard its result, so enable psql timing or capture server-side metrics explicitly. TPC-H and TPC-DS use fixed query parameters, matching the limitation documented by the underlying DuckDB generators; they are not substitute workloads for an application’s parameter distribution.

Data generation can exhaust memory and consume substantial object-storage capacity, bandwidth, and time. Keep scale, credentials, region, caches, concurrency, and server settings identical when comparing results, and do not present a single run as a portable performance guarantee.

Upstream 3.6.0

Upstream 3.6.0 adds PostgreSQL 19 support and uses DuckDB 1.5.6. Deploy matching libraries and pgduck_server, keep pg_extension_base preloaded, restart loaded processes and apply the supplied SQL updates to version 3.6. This component’s 3.5-to-3.6 SQL migration is empty; the matching runtime and its dependencies still need the coordinated release upgrade.

Upstream 3.7.0

The current reviewed release is 3.7.0 and this component’s control version is 3.7. Earlier version sections describe historical behavior and package examples. Upgrade the complete family with matching libraries and pgduck_server, restart processes holding old code, and apply the supplied extension updates to SQL version 3.7. This does not establish package availability.

Table reader