Skip to content

Getting Started

The best way to understand how dbworkload works is by running through a good example.

We will be using PostgreSQL Server and CockroachDB, but the same logic applies to any of the supported technologies.

Not using Postgres?

You can find equivalent files for other DBMS's in the workloads directory.

In this tutorial, we will go through the following tasks:

  1. As a prerequisite, we setup our working environment.
  2. We start with the DDL of a few tables and the SQL statements that are routinely executed against these tables.
  3. We generate some random datasets for seeding the database tables.
  4. We then create the tables in our database, and import the generated dataset.
  5. From the SQL statements, we create the dbworkload class file, that is, our workload file.
  6. We run the workload, saving stats to a CSV file.
  7. We collect the information and plot a chart to display the results of the test run.

By the end of this tutorial, you should have an understanding about how to use dbworkload to create your own workload, run your benchmark tests, and display the results.