Skip to content

Instantly share code, notes, and snippets.

@akorotkov
Last active May 27, 2020 09:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akorotkov/4a1b499c1b6684139b91dd694e1ec19c to your computer and use it in GitHub Desktop.
Save akorotkov/4a1b499c1b6684139b91dd694e1ec19c to your computer and use it in GitHub Desktop.
bloat_bench
CREATE TABLE test (
id integer primary key,
value1 float8 not null,
value2 float8 not null,
value3 float8 not null,
value4 float8 not null,
ts timestamp not null
);
CREATE INDEX test_value1_idx ON test (value1);
CREATE INDEX test_value2_idx ON test (value2);
CREATE INDEX test_value3_idx ON test (value3);
CREATE INDEX test_value4_idx ON test (value4);
CREATE INDEX test_ts_idx ON test (ts);
\set id random(1, 10000000)
INSERT INTO test VALUES(:id, random(), random(), random(), random(), now() - random() * random() * 1800 * interval '1 second')
ON CONFLICT (id) DO UPDATE SET ts = now();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment