Skip to content

Quick start

Requirements

  • Docker Desktop or Docker Engine with the Compose plugin
  • At least 4 GB of memory available to Docker
  • GNU Make (optional; see the Make-free workflow)
  • Approximately 5 GB of free disk for the small profile; larger profiles need considerably more

Set up the lab

From the repository root:

cp .env.example .env
make setup PROFILE=test
make stats
make verify
make first-lab

The test profile is intentionally small and is used to confirm correctness. After it passes, rebuild with PROFILE=small for performance behavior that is easier to observe on a laptop.

make setup PROFILE=small

Next, read Lab 01 — Establish the Baseline before interpreting the first query.

Dataset profiles

Profile Customers Products Orders Order items (approx.) Activity Intended use
test 1K 500 5K 20K 10K Fast validation
small 100K 50K 500K 2M 2M Laptop labs
medium 1M 500K 10M 40M Workstation or GCP
large 2M 750K 30M 120M Final-scale behavior

The generator deliberately creates hot customers, hot products, recent-data concentration, status skew, and uneven categories. Runtime and storage depend on hardware and PostgreSQL configuration.

Connect to PostgreSQL

Open an interactive psql session:

make shell

For a graphical interface, start pgAdmin:

make ui

Then open http://localhost:5050. Sign in with the values in .env (the defaults are lab@example.com and labadmin) and register a server with:

Setting Default
Host postgres
Port 5432
Database commerce_lab
Username lab
Password lab

Connect with DBeaver or another GUI

If you prefer a desktop client, DBeaver Community Edition is a free, open-source option that visualizes execution plans. Connect with the same settings:

Setting Default
Host localhost
Port 5432
Database commerce_lab
Username lab
Password lab

To see a visual query plan in DBeaver:

  1. Open SQL Editor and write or paste a query.
  2. Click Explain Execution Plan (or press Ctrl+Shift+E / Cmd+Shift+E).
  3. DBeaver shows the plan as a tree with estimated and actual costs, row counts, and node types.

Other open-source PostgreSQL clients such as Beekeeper Studio or pgAdmin (already included above) can also display plans. Use whichever tool lets you compare plans quickly.

See Local Docker for lifecycle, port, and reset commands.