
\timing on

CREATE TABLE foo (date timestamptz, a int, b text) PARTITION by range(date);

CREATE UNLOGGED TABLE foo_2020_s1 PARTITION OF foo FOR VALUES FROM ('2020-01-01') to ('2020-07-01') WITH (autovacuum_enabled = off);
CREATE UNLOGGED TABLE foo_2020_s2 PARTITION OF foo FOR VALUES FROM ('2020-07-01') to ('2021-01-01') WITH (autovacuum_enabled = off);

CREATE UNLOGGED TABLE foo_2021_s1 PARTITION OF foo FOR VALUES FROM ('2021-01-01') to ('2021-07-01') WITH (autovacuum_enabled = off);
CREATE UNLOGGED TABLE foo_2021_s2 PARTITION OF foo FOR VALUES FROM ('2021-07-01') to ('2022-01-01') WITH (autovacuum_enabled = off);

CREATE UNLOGGED TABLE bar (date timestamptz, a int, c text) WITH (autovacuum_enabled = off);

INSERT INTO foo SELECT timestamptz '2020-01-01 00:00:00' + interval '30 second'*i, i, md5(i::text)
FROM generate_series (0,2000000) i;

INSERT INTO bar SELECT timestamptz '2020-01-01 00:00:00' + interval '30 second'*(i/3), i/3, md5(i::text)
FROM generate_series (0,6000000) i;
