Skip to content

Instantly share code, notes, and snippets.

@1ma
Created June 2, 2017 08:55
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1ma/c837e6f30c0869cfc1222f67ac8b1c52 to your computer and use it in GitHub Desktop.
Save 1ma/c837e6f30c0869cfc1222f67ac8b1c52 to your computer and use it in GitHub Desktop.
-- 100 million INSERTs benchmark
-- stock PostgreSQL 9.6 setup running on an Ubuntu 16.04 workstation
-- PK TYPE INSERT* time (ms) Relative time AVG throughput (op/s)
------------------------------------------------------------------------
-- BIGSERIAL 242,849.46 1.00 411,777.73
-- UUID COMB 337,028.15 1.39 296,711.12
-- UUID 1 470,385.37 1.94 212,591.65
-- UUID 4 7,808,502.45 32.15 12,806.55
------------------------------------------------------------------------
CREATE TABLE uuids (
id UUID PRIMARY KEY
);
CREATE TABLE serials (
id BIGSERIAL PRIMARY KEY
);
-- *not quite, done like this (and truncating the table inbetween tests):
COPY uuids FROM '/some/path/uuid1.csv';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment