Skip to content

Preparation

For this tutorial, we assume you have a CockroachDB or PostgreSQL Server running locally and accessible at localhost.

Make sure dbworkload is installed on your machine, see how at Installation.

Create a directory workloads to store all our files.

mkdir workloads
cd workloads

For reference, here are the URI used to connect to my local instances

PostgreSQL

$ psql 'postgres://fabio:postgres@localhost:5432/postgres?sslmode=disable'
Timing is on.
psql (16.2)
Type "help" for help.

postgres=# select version();
                                                              version                                                               
------------------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 16.2 (Postgres.app) on aarch64-apple-darwin21.6.0, compiled by Apple clang version 14.0.0 (clang-1400.0.29.102), 64-bit
(1 row)

Time: 1.926 ms
postgres=# 

CockroachDB

$ cockroach sql --url 'postgres://cockroach:cockroach@localhost:26257/defaultdb?sslmode=require'
#
# Welcome to the CockroachDB SQL shell.
# All statements must be terminated by a semicolon.
# To exit, type: \q.
#
# Server version: CockroachDB CCL v24.2.3 (x86_64-apple-darwin19, built 2024/09/23 22:30:57, go1.22.5 X:nocoverageredesign) (same version as client)
# Cluster ID: e360faa9-2ba3-4e92-bd51-fc7e88cf24a8
# Organization: Workshop
#
# Enter \? for a brief introduction.
#
cockroach@localhost:26257/defaultdb> select version();
                                                   version
-------------------------------------------------------------------------------------------------------------
  CockroachDB CCL v24.2.3 (x86_64-apple-darwin19, built 2024/09/23 22:30:57, go1.22.5 X:nocoverageredesign)
(1 row)

Time: 1ms total (execution 1ms / network 0ms)

cockroach@localhost:26257/defaultdb>

Want to use another DBMS technology?

If you prefer to run the tutorial using another DBMS you can take the required files from the workloads directory.