Skip to content

Commit

Permalink
Reduce size of shared test tables
Browse files Browse the repository at this point in the history
In order to reduce the runtime of the shared tests we reduce the number
of rows in the tables used for the shared tests by increasing the
interval between the time samples. This reduce the number of rows
without reducing the upper and lower ranges. This changes the number of
rows in the plans, so we have to update the tests accordingly.
  • Loading branch information
mkindahl committed Jan 14, 2025
1 parent 6623eb6 commit c9c4eca
Show file tree
Hide file tree
Showing 17 changed files with 3,543 additions and 3,573 deletions.
260 changes: 128 additions & 132 deletions tsl/test/shared/expected/constraint_exclusion_prepared.out

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions tsl/test/shared/expected/decompress_join.out
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ QUERY PLAN
Limit (actual rows=1 loops=1)
-> Hash Join (actual rows=1 loops=1)
Hash Cond: ((m_1."time" = t."time") AND (m_1.device_id = t.device_id))
-> Append (actual rows=43181 loops=1)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m_1 (actual rows=17990 loops=1)
-> Seq Scan on compress_hyper_X_X_chunk (actual rows=20 loops=1)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m_2 (actual rows=25190 loops=1)
-> Seq Scan on compress_hyper_X_X_chunk (actual rows=30 loops=1)
-> Append (actual rows=8641 loops=1)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m_1 (actual rows=3600 loops=1)
-> Seq Scan on compress_hyper_X_X_chunk (actual rows=5 loops=1)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m_2 (actual rows=5040 loops=1)
-> Seq Scan on compress_hyper_X_X_chunk (actual rows=10 loops=1)
-> Custom Scan (DecompressChunk) on _hyper_X_X_chunk m_3 (actual rows=1 loops=1)
-> Seq Scan on compress_hyper_X_X_chunk (actual rows=1 loops=1)
-> Hash (actual rows=10 loops=1)
Expand Down
214 changes: 106 additions & 108 deletions tsl/test/shared/expected/memoize.out

Large diffs are not rendered by default.

862 changes: 431 additions & 431 deletions tsl/test/shared/expected/ordered_append-14.out

Large diffs are not rendered by default.

886 changes: 443 additions & 443 deletions tsl/test/shared/expected/ordered_append-15.out

Large diffs are not rendered by default.

886 changes: 443 additions & 443 deletions tsl/test/shared/expected/ordered_append-16.out

Large diffs are not rendered by default.

886 changes: 443 additions & 443 deletions tsl/test/shared/expected/ordered_append-17.out

Large diffs are not rendered by default.

624 changes: 309 additions & 315 deletions tsl/test/shared/expected/ordered_append_join-14.out

Large diffs are not rendered by default.

624 changes: 309 additions & 315 deletions tsl/test/shared/expected/ordered_append_join-15.out

Large diffs are not rendered by default.

624 changes: 309 additions & 315 deletions tsl/test/shared/expected/ordered_append_join-16.out

Large diffs are not rendered by default.

624 changes: 309 additions & 315 deletions tsl/test/shared/expected/ordered_append_join-17.out

Large diffs are not rendered by default.

144 changes: 72 additions & 72 deletions tsl/test/shared/expected/transparent_decompress_chunk-14.out

Large diffs are not rendered by default.

148 changes: 74 additions & 74 deletions tsl/test/shared/expected/transparent_decompress_chunk-15.out

Large diffs are not rendered by default.

148 changes: 74 additions & 74 deletions tsl/test/shared/expected/transparent_decompress_chunk-16.out

Large diffs are not rendered by default.

148 changes: 74 additions & 74 deletions tsl/test/shared/expected/transparent_decompress_chunk-17.out

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tsl/test/shared/sql/include/constraint_exclusion_prepared.sql
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ RESET timescaledb.enable_chunk_append;
SET plan_cache_mode TO force_generic_plan;
PREPARE prep(timestamptz) AS SELECT device_id, time FROM :TEST_TABLE WHERE time = $1;

:PREFIX EXECUTE prep('2000-01-01 23:42');
:PREFIX EXECUTE prep('2000-01-10 23:42');
:PREFIX EXECUTE prep('2000-01-01 23:40');
:PREFIX EXECUTE prep('2000-01-10 23:40');
:PREFIX EXECUTE prep(now());

DEALLOCATE prep;
Expand Down
24 changes: 12 additions & 12 deletions tsl/test/shared/sql/include/shared_setup.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ CREATE TABLE metrics(filler_1 int, filler_2 int, filler_3 int, time timestamptz
SELECT create_hypertable('metrics','time',create_default_indexes:=false);

ALTER TABLE metrics DROP COLUMN filler_1;
INSERT INTO metrics(time,device_id,v0,v1,v2,v3) SELECT time, device_id, device_id+1, device_id + 2, device_id + 0.5, NULL FROM generate_series('2000-01-01 0:00:00+0'::timestamptz,'2000-01-05 23:55:00+0','2m') gtime(time), generate_series(1,5,1) gdevice(device_id);
INSERT INTO metrics(time,device_id,v0,v1,v2,v3) SELECT time, device_id, device_id+1, device_id + 2, device_id + 0.5, NULL FROM generate_series('2000-01-01 0:00:00+0'::timestamptz,'2000-01-05 23:55:00+0','10m') gtime(time), generate_series(1,5,1) gdevice(device_id);
ALTER TABLE metrics DROP COLUMN filler_2;
INSERT INTO metrics(time,device_id,v0,v1,v2,v3) SELECT time, device_id, device_id-1, device_id + 2, device_id + 0.5, NULL FROM generate_series('2000-01-06 0:00:00+0'::timestamptz,'2000-01-12 23:55:00+0','2m') gtime(time), generate_series(1,5,1) gdevice(device_id);
INSERT INTO metrics(time,device_id,v0,v1,v2,v3) SELECT time, device_id, device_id-1, device_id + 2, device_id + 0.5, NULL FROM generate_series('2000-01-06 0:00:00+0'::timestamptz,'2000-01-12 23:55:00+0','10m') gtime(time), generate_series(1,5,1) gdevice(device_id);
ALTER TABLE metrics DROP COLUMN filler_3;
INSERT INTO metrics(time,device_id,v0,v1,v2,v3) SELECT time, device_id, device_id, device_id + 2, device_id + 0.5, NULL FROM generate_series('2000-01-13 0:00:00+0'::timestamptz,'2000-01-19 23:55:00+0','2m') gtime(time), generate_series(1,5,1) gdevice(device_id);
INSERT INTO metrics(time,device_id,v0,v1,v2,v3) SELECT time, device_id, device_id, device_id + 2, device_id + 0.5, NULL FROM generate_series('2000-01-13 0:00:00+0'::timestamptz,'2000-01-19 23:55:00+0','10m') gtime(time), generate_series(1,5,1) gdevice(device_id);
CREATE INDEX ON metrics(time DESC);
CREATE INDEX ON metrics(device_id,time DESC);
ANALYZE metrics;
Expand All @@ -31,11 +31,11 @@ CREATE TABLE metrics_space(filler_1 int, filler_2 int, filler_3 int, time timest
SELECT create_hypertable('metrics_space','time','device_id',3,create_default_indexes:=false);

ALTER TABLE metrics_space DROP COLUMN filler_1;
INSERT INTO metrics_space(time,device_id,v0,v1,v2,v3) SELECT time, device_id, device_id+1, device_id + 2, device_id + 0.5, NULL FROM generate_series('2000-01-01 0:00:00+0'::timestamptz,'2000-01-05 23:55:00+0','2m') gtime(time), generate_series(1,5,1) gdevice(device_id);
INSERT INTO metrics_space(time,device_id,v0,v1,v2,v3) SELECT time, device_id, device_id+1, device_id + 2, device_id + 0.5, NULL FROM generate_series('2000-01-01 0:00:00+0'::timestamptz,'2000-01-05 23:55:00+0','10m') gtime(time), generate_series(1,5,1) gdevice(device_id);
ALTER TABLE metrics_space DROP COLUMN filler_2;
INSERT INTO metrics_space(time,device_id,v0,v1,v2,v3) SELECT time, device_id, device_id+1, device_id + 2, device_id + 0.5, NULL FROM generate_series('2000-01-06 0:00:00+0'::timestamptz,'2000-01-12 23:55:00+0','2m') gtime(time), generate_series(1,5,1) gdevice(device_id);
INSERT INTO metrics_space(time,device_id,v0,v1,v2,v3) SELECT time, device_id, device_id+1, device_id + 2, device_id + 0.5, NULL FROM generate_series('2000-01-06 0:00:00+0'::timestamptz,'2000-01-12 23:55:00+0','10m') gtime(time), generate_series(1,5,1) gdevice(device_id);
ALTER TABLE metrics_space DROP COLUMN filler_3;
INSERT INTO metrics_space(time,device_id,v0,v1,v2,v3) SELECT time, device_id, device_id+1, device_id + 2, device_id + 0.5, NULL FROM generate_series('2000-01-13 0:00:00+0'::timestamptz,'2000-01-19 23:55:00+0','2m') gtime(time), generate_series(1,5,1) gdevice(device_id);
INSERT INTO metrics_space(time,device_id,v0,v1,v2,v3) SELECT time, device_id, device_id+1, device_id + 2, device_id + 0.5, NULL FROM generate_series('2000-01-13 0:00:00+0'::timestamptz,'2000-01-19 23:55:00+0','10m') gtime(time), generate_series(1,5,1) gdevice(device_id);
CREATE INDEX ON metrics_space(time);
CREATE INDEX ON metrics_space(device_id,time);
ANALYZE metrics_space;
Expand All @@ -46,11 +46,11 @@ CREATE TABLE metrics_compressed(filler_1 int, filler_2 int, filler_3 int, time t
SELECT create_hypertable('metrics_compressed','time',create_default_indexes:=false);

ALTER TABLE metrics_compressed DROP COLUMN filler_1;
INSERT INTO metrics_compressed(time,device_id,v0,v1,v2,v3) SELECT time, device_id, device_id+1, device_id + 2, device_id + 0.5, NULL FROM generate_series('2000-01-01 0:00:00+0'::timestamptz,'2000-01-05 23:55:00+0','2m') gtime(time), generate_series(1,5,1) gdevice(device_id);
INSERT INTO metrics_compressed(time,device_id,v0,v1,v2,v3) SELECT time, device_id, device_id+1, device_id + 2, device_id + 0.5, NULL FROM generate_series('2000-01-01 0:00:00+0'::timestamptz,'2000-01-05 23:55:00+0','10m') gtime(time), generate_series(1,5,1) gdevice(device_id);
ALTER TABLE metrics_compressed DROP COLUMN filler_2;
INSERT INTO metrics_compressed(time,device_id,v0,v1,v2,v3) SELECT time, device_id, device_id-1, device_id + 2, device_id + 0.5, NULL FROM generate_series('2000-01-06 0:00:00+0'::timestamptz,'2000-01-12 23:55:00+0','2m') gtime(time), generate_series(1,5,1) gdevice(device_id);
INSERT INTO metrics_compressed(time,device_id,v0,v1,v2,v3) SELECT time, device_id, device_id-1, device_id + 2, device_id + 0.5, NULL FROM generate_series('2000-01-06 0:00:00+0'::timestamptz,'2000-01-12 23:55:00+0','10m') gtime(time), generate_series(1,5,1) gdevice(device_id);
ALTER TABLE metrics_compressed DROP COLUMN filler_3;
INSERT INTO metrics_compressed(time,device_id,v0,v1,v2,v3) SELECT time, device_id, device_id, device_id + 2, device_id + 0.5, NULL FROM generate_series('2000-01-13 0:00:00+0'::timestamptz,'2000-01-19 23:55:00+0','2m') gtime(time), generate_series(1,5,1) gdevice(device_id);
INSERT INTO metrics_compressed(time,device_id,v0,v1,v2,v3) SELECT time, device_id, device_id, device_id + 2, device_id + 0.5, NULL FROM generate_series('2000-01-13 0:00:00+0'::timestamptz,'2000-01-19 23:55:00+0','10m') gtime(time), generate_series(1,5,1) gdevice(device_id);
CREATE INDEX ON metrics_compressed(time);
CREATE INDEX ON metrics_compressed(device_id,time);
ANALYZE metrics_compressed;
Expand All @@ -69,11 +69,11 @@ CREATE TABLE metrics_space_compressed(filler_1 int, filler_2 int, filler_3 int,
SELECT create_hypertable('metrics_space_compressed','time','device_id',3,create_default_indexes:=false);

ALTER TABLE metrics_space_compressed DROP COLUMN filler_1;
INSERT INTO metrics_space_compressed(time,device_id,v0,v1,v2,v3) SELECT time, device_id, device_id+1, device_id + 2, device_id + 0.5, NULL FROM generate_series('2000-01-01 0:00:00+0'::timestamptz,'2000-01-05 23:55:00+0','2m') gtime(time), generate_series(1,5,1) gdevice(device_id);
INSERT INTO metrics_space_compressed(time,device_id,v0,v1,v2,v3) SELECT time, device_id, device_id+1, device_id + 2, device_id + 0.5, NULL FROM generate_series('2000-01-01 0:00:00+0'::timestamptz,'2000-01-05 23:55:00+0','10m') gtime(time), generate_series(1,5,1) gdevice(device_id);
ALTER TABLE metrics_space_compressed DROP COLUMN filler_2;
INSERT INTO metrics_space_compressed(time,device_id,v0,v1,v2,v3) SELECT time, device_id, device_id+1, device_id + 2, device_id + 0.5, NULL FROM generate_series('2000-01-06 0:00:00+0'::timestamptz,'2000-01-12 23:55:00+0','2m') gtime(time), generate_series(1,5,1) gdevice(device_id);
INSERT INTO metrics_space_compressed(time,device_id,v0,v1,v2,v3) SELECT time, device_id, device_id+1, device_id + 2, device_id + 0.5, NULL FROM generate_series('2000-01-06 0:00:00+0'::timestamptz,'2000-01-12 23:55:00+0','10m') gtime(time), generate_series(1,5,1) gdevice(device_id);
ALTER TABLE metrics_space_compressed DROP COLUMN filler_3;
INSERT INTO metrics_space_compressed(time,device_id,v0,v1,v2,v3) SELECT time, device_id, device_id+1, device_id + 2, device_id + 0.5, NULL FROM generate_series('2000-01-13 0:00:00+0'::timestamptz,'2000-01-19 23:55:00+0','2m') gtime(time), generate_series(1,5,1) gdevice(device_id);
INSERT INTO metrics_space_compressed(time,device_id,v0,v1,v2,v3) SELECT time, device_id, device_id+1, device_id + 2, device_id + 0.5, NULL FROM generate_series('2000-01-13 0:00:00+0'::timestamptz,'2000-01-19 23:55:00+0','10m') gtime(time), generate_series(1,5,1) gdevice(device_id);
CREATE INDEX ON metrics_space_compressed(time);
CREATE INDEX ON metrics_space_compressed(device_id,time);
ANALYZE metrics_space_compressed;
Expand Down

0 comments on commit c9c4eca

Please sign in to comment.