Last active
May 27, 2020 09:39
-
-
Save akorotkov/4a1b499c1b6684139b91dd694e1ec19c to your computer and use it in GitHub Desktop.
bloat_bench
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\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