dbt2

OSDL-DBT-2 test kit

Overview

PackageVersionCategoryLicenseLanguage
dbt20.61.7LANGArtistic-2.0C
IDExtensionBinLibLoadCreateTrustRelocSchema
3220dbt2NoYesNoYesNoYes-
Relatedpgtap faker plpgsql pg_stat_statements pg_tle plv8 pllua hstore_pllua

Package/source version 0.61.7; SQL extension version 0.45.0. This package contains the PostgreSQL stored-function extension, not the full DBT-2 benchmark toolchain.

Version

TypeRepoVersionPG VerPackageDeps
EXTMIXED0.61.71817161514dbt2-
RPMPGDG0.61.71817161514dbt2-pg$v-extensions-
DEBPIGSTY0.61.71817161514postgresql-$v-dbt2-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
PIGSTY 0.61.7
PIGSTY 0.61.7
el8.aarch64
PIGSTY 0.61.7
PIGSTY 0.61.7
el9.x86_64
el9.aarch64
el10.x86_64
el10.aarch64
d12.x86_64
d12.aarch64
d13.x86_64
d13.aarch64
u22.x86_64
u22.aarch64
u24.x86_64
u24.aarch64
u26.x86_64
u26.aarch64

Build

You can build the DEB packages for dbt2 using pig build:

pig build pkg dbt2         # build DEB packages

Install

You can install dbt2 directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:

pig repo add pgsql -u          # Add repo and update cache

Install the extension using pig or apt/yum/dnf:

pig install dbt2;          # Install for current active PG version
pig ext install -y dbt2 -v 18  # PG 18
pig ext install -y dbt2 -v 17  # PG 17
pig ext install -y dbt2 -v 16  # PG 16
pig ext install -y dbt2 -v 15  # PG 15
pig ext install -y dbt2 -v 14  # PG 14
dnf install -y dbt2-pg18-extensions       # PG 18
dnf install -y dbt2-pg17-extensions       # PG 17
dnf install -y dbt2-pg16-extensions       # PG 16
dnf install -y dbt2-pg15-extensions       # PG 15
dnf install -y dbt2-pg14-extensions       # PG 14
apt install -y postgresql-18-dbt2   # PG 18
apt install -y postgresql-17-dbt2   # PG 17
apt install -y postgresql-16-dbt2   # PG 16
apt install -y postgresql-15-dbt2   # PG 15
apt install -y postgresql-14-dbt2   # PG 14

Create Extension:

CREATE EXTENSION dbt2;

Usage

dbt2: OSDL-DBT-2 test kit

dbt2 is a TPC-C benchmark implementation for PostgreSQL. The extension provides stored procedures that implement the five standard TPC-C transaction types.

CREATE EXTENSION dbt2;

TPC-C Transaction Types

The extension provides stored procedures for the five standard TPC-C transactions:

  • New Order: Creates a new order with multiple line items, updating stock levels
  • Payment: Processes a customer payment, updating warehouse and district balances
  • Order Status: Retrieves the status of a customer’s most recent order
  • Delivery: Processes pending orders for delivery across all districts
  • Stock Level: Checks the count of recently sold items with low stock

Benchmark Workflow

The dbt2 system consists of:

  1. Database extension (dbt2): Stored procedures for TPC-C transactions
  2. Data loader: Populates the benchmark tables with TPC-C data
  3. Driver: Generates transaction workloads simulating terminal users
  4. Client: Manages connections between the driver and database

Running Benchmarks

The benchmark is typically run using the dbt2 command-line tools (separate from the extension):

# Build the benchmark database
dbt2 build --dbms pgsql --warehouses 10

# Run the benchmark
dbt2 run --dbms pgsql --warehouses 10 --duration 300 --connections 10

# Generate report
dbt2 report --dbms pgsql

TPC-C Schema

The benchmark uses these standard tables: warehouse, district, customer, history, new_order, orders, order_line, item, and stock.

Refer to the doc/ directory in the repository for detailed configuration and tuning options.


Last Modified 2026-07-23: update extension list to 555 (d81fc56)