Skip to content

Commit 3f795ea

Browse files
committed
Stabilize ordered_append test
Plan switches from Index Only Scan to Index Scan suggest visibility map race condition. Adding FREEZE to the VACUUM command makes sure visibility map is up to date and reduces plan time inconsistencies.
1 parent 1a0718f commit 3f795ea

5 files changed

Lines changed: 17 additions & 17 deletions

File tree

tsl/test/expected/ordered_append-15.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ set enable_nestloop to off;
128128
-- SequentialScans. Disable the optimization for the following tests to ensure we have
129129
-- stable query plans in all CI environments.
130130
SET timescaledb.enable_decompression_sorted_merge = 0;
131-
vacuum analyze :TEST_TABLE;
131+
vacuum (analyze, freeze) :TEST_TABLE;
132132
-- test ASC for ordered chunks
133133
:PREFIX
134134
SELECT time
@@ -782,7 +782,7 @@ LIMIT 3;
782782
-- SequentialScans. Disable the optimization for the following tests to ensure we have
783783
-- stable query plans in all CI environments.
784784
SET timescaledb.enable_decompression_sorted_merge = 0;
785-
vacuum analyze :TEST_TABLE;
785+
vacuum (analyze, freeze) :TEST_TABLE;
786786
-- test ASC for ordered chunks
787787
:PREFIX
788788
SELECT time
@@ -1847,7 +1847,7 @@ LIMIT 3;
18471847
-- SequentialScans. Disable the optimization for the following tests to ensure we have
18481848
-- stable query plans in all CI environments.
18491849
SET timescaledb.enable_decompression_sorted_merge = 0;
1850-
vacuum analyze :TEST_TABLE;
1850+
vacuum (analyze, freeze) :TEST_TABLE;
18511851
-- test ASC for ordered chunks
18521852
:PREFIX
18531853
SELECT time
@@ -2838,7 +2838,7 @@ LIMIT 3;
28382838
-- SequentialScans. Disable the optimization for the following tests to ensure we have
28392839
-- stable query plans in all CI environments.
28402840
SET timescaledb.enable_decompression_sorted_merge = 0;
2841-
vacuum analyze :TEST_TABLE;
2841+
vacuum (analyze, freeze) :TEST_TABLE;
28422842
-- test ASC for ordered chunks
28432843
:PREFIX
28442844
SELECT time

tsl/test/expected/ordered_append-16.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ set enable_nestloop to off;
128128
-- SequentialScans. Disable the optimization for the following tests to ensure we have
129129
-- stable query plans in all CI environments.
130130
SET timescaledb.enable_decompression_sorted_merge = 0;
131-
vacuum analyze :TEST_TABLE;
131+
vacuum (analyze, freeze) :TEST_TABLE;
132132
-- test ASC for ordered chunks
133133
:PREFIX
134134
SELECT time
@@ -782,7 +782,7 @@ LIMIT 3;
782782
-- SequentialScans. Disable the optimization for the following tests to ensure we have
783783
-- stable query plans in all CI environments.
784784
SET timescaledb.enable_decompression_sorted_merge = 0;
785-
vacuum analyze :TEST_TABLE;
785+
vacuum (analyze, freeze) :TEST_TABLE;
786786
-- test ASC for ordered chunks
787787
:PREFIX
788788
SELECT time
@@ -1847,7 +1847,7 @@ LIMIT 3;
18471847
-- SequentialScans. Disable the optimization for the following tests to ensure we have
18481848
-- stable query plans in all CI environments.
18491849
SET timescaledb.enable_decompression_sorted_merge = 0;
1850-
vacuum analyze :TEST_TABLE;
1850+
vacuum (analyze, freeze) :TEST_TABLE;
18511851
-- test ASC for ordered chunks
18521852
:PREFIX
18531853
SELECT time
@@ -2838,7 +2838,7 @@ LIMIT 3;
28382838
-- SequentialScans. Disable the optimization for the following tests to ensure we have
28392839
-- stable query plans in all CI environments.
28402840
SET timescaledb.enable_decompression_sorted_merge = 0;
2841-
vacuum analyze :TEST_TABLE;
2841+
vacuum (analyze, freeze) :TEST_TABLE;
28422842
-- test ASC for ordered chunks
28432843
:PREFIX
28442844
SELECT time

tsl/test/expected/ordered_append-17.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ set enable_nestloop to off;
128128
-- SequentialScans. Disable the optimization for the following tests to ensure we have
129129
-- stable query plans in all CI environments.
130130
SET timescaledb.enable_decompression_sorted_merge = 0;
131-
vacuum analyze :TEST_TABLE;
131+
vacuum (analyze, freeze) :TEST_TABLE;
132132
-- test ASC for ordered chunks
133133
:PREFIX
134134
SELECT time
@@ -770,7 +770,7 @@ LIMIT 3;
770770
-- SequentialScans. Disable the optimization for the following tests to ensure we have
771771
-- stable query plans in all CI environments.
772772
SET timescaledb.enable_decompression_sorted_merge = 0;
773-
vacuum analyze :TEST_TABLE;
773+
vacuum (analyze, freeze) :TEST_TABLE;
774774
-- test ASC for ordered chunks
775775
:PREFIX
776776
SELECT time
@@ -1799,7 +1799,7 @@ LIMIT 3;
17991799
-- SequentialScans. Disable the optimization for the following tests to ensure we have
18001800
-- stable query plans in all CI environments.
18011801
SET timescaledb.enable_decompression_sorted_merge = 0;
1802-
vacuum analyze :TEST_TABLE;
1802+
vacuum (analyze, freeze) :TEST_TABLE;
18031803
-- test ASC for ordered chunks
18041804
:PREFIX
18051805
SELECT time
@@ -2778,7 +2778,7 @@ LIMIT 3;
27782778
-- SequentialScans. Disable the optimization for the following tests to ensure we have
27792779
-- stable query plans in all CI environments.
27802780
SET timescaledb.enable_decompression_sorted_merge = 0;
2781-
vacuum analyze :TEST_TABLE;
2781+
vacuum (analyze, freeze) :TEST_TABLE;
27822782
-- test ASC for ordered chunks
27832783
:PREFIX
27842784
SELECT time

tsl/test/expected/ordered_append-18.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ set enable_nestloop to off;
128128
-- SequentialScans. Disable the optimization for the following tests to ensure we have
129129
-- stable query plans in all CI environments.
130130
SET timescaledb.enable_decompression_sorted_merge = 0;
131-
vacuum analyze :TEST_TABLE;
131+
vacuum (analyze, freeze) :TEST_TABLE;
132132
-- test ASC for ordered chunks
133133
:PREFIX
134134
SELECT time
@@ -770,7 +770,7 @@ LIMIT 3;
770770
-- SequentialScans. Disable the optimization for the following tests to ensure we have
771771
-- stable query plans in all CI environments.
772772
SET timescaledb.enable_decompression_sorted_merge = 0;
773-
vacuum analyze :TEST_TABLE;
773+
vacuum (analyze, freeze) :TEST_TABLE;
774774
-- test ASC for ordered chunks
775775
:PREFIX
776776
SELECT time
@@ -1799,7 +1799,7 @@ LIMIT 3;
17991799
-- SequentialScans. Disable the optimization for the following tests to ensure we have
18001800
-- stable query plans in all CI environments.
18011801
SET timescaledb.enable_decompression_sorted_merge = 0;
1802-
vacuum analyze :TEST_TABLE;
1802+
vacuum (analyze, freeze) :TEST_TABLE;
18031803
-- test ASC for ordered chunks
18041804
:PREFIX
18051805
SELECT time
@@ -2778,7 +2778,7 @@ LIMIT 3;
27782778
-- SequentialScans. Disable the optimization for the following tests to ensure we have
27792779
-- stable query plans in all CI environments.
27802780
SET timescaledb.enable_decompression_sorted_merge = 0;
2781-
vacuum analyze :TEST_TABLE;
2781+
vacuum (analyze, freeze) :TEST_TABLE;
27822782
-- test ASC for ordered chunks
27832783
:PREFIX
27842784
SELECT time

tsl/test/sql/include/ordered_append.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
SET timescaledb.enable_decompression_sorted_merge = 0;
1313

14-
vacuum analyze :TEST_TABLE;
14+
vacuum (analyze, freeze) :TEST_TABLE;
1515

1616
-- test ASC for ordered chunks
1717
:PREFIX

0 commit comments

Comments
 (0)