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 resultsThe 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.