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]