How To Run a TPC-H-like Benchmark in 2 Short Steps

July 19, 2023

Continuing on from How To Run a Complex Postgres Benchmark Easily - Master TPC-C in 3 Short Steps, where I simplified the execution of a complex benchmark such that it is as easy to run as pgbench, we now move on to the TPC Benchmark (TM) H (TPC-H).  The TPC-H is a decision support benchmark consisting of a suite of business oriented ad-hoc queries and concurrent data modifications.

Database Test 3 (DBT-3) is a fair-use open source implementation that helps execute this benchmark.  Try the AppImage, which we will rename to dbt3 for brevity in this example.

The next thing to do is to download the TPC-H Tools, because of distribution rules for TPC provided code, and to unzip it.  You will still need a C compiler, make and patch on the system for the DBT-3 AppImage to build the TPC-H Tools and prepare a set of query templates:

dbt3 build-dbgen pgsql "TPC-H V3.0.1"

The next command will run the full benchmark that includes the load, power, and throughput tests using default value of 1 GB for the scale factor with 2 refresh streams and save the results in a directory results:

dbt3 run --tpchtools="TPC-H V3.0.1" pgsql results

The scores of the test will be displayed once the test completes:

       Composite Score:    10266.16
Load Test Time (hours):         .01
      Power Test Score:     9990.70
 Throughput Test Score:    10549.22


Want to try it? The documentation is also available online.

Share this

Relevant Blogs

Autovacuum Tuning Basics

A few weeks ago I covered the basics of tuning checkpoints, and in that post I also mentioned autovacuum as the second common source of performance issues (based on what...
July 15, 2024

More Blogs

Basics of Tuning Checkpoints

On systems doing non-trivial number of writes, tuning checkpoints is crucial for getting good performance. Yet checkpoints are one of the areas where we often identify confusion and configuration issues...
July 11, 2024