Help us shape the future of Go! Take the 2026 Go Developer Survey

uuid_keys

command
v0.5.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Command uuid_keys is Load Experiment 9 (#525): what a random UUIDv4 primary key costs the hot tables against a time-ordered UUIDv7, at insert time.

It creates two scratch tables of the width of a task instance row, one keyed by a random UUIDv4 (what gen_random_uuid(), the default of every table today, returns) and one by a UUIDv7, both generated in the client, and fills them in turns, --batch rows per transaction through COPY, so both see the same checkpoints and the same cache pressure. For each key it reports the insert rate overall and over the last tenth of the rows (once the primary key index outgrows the cache), the WAL written, the size of the primary key index and of the table, and the rate of point lookups by key. The tables are dropped at the end.

Usage:

DATABASE_URL='postgres://leoflow:leoflow@localhost:5432/leoflow?sslmode=disable' \
  go run ./test/load/uuid_keys [--rows 2000000] [--batch 1000]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL