Skip to content

Commit 9744fe2

Browse files
Use DELETE instead of UPDATE to speed up vacuum test
e2e9928 introduced a test which generated dead tuples for vacuum with an UPDATE. The test only required enough dead TIDs for two rounds of index vacuuming. This can be accomplished with a DELETE instead of an UPDATE -- which generates about 50% less WAL and makes the test 20% faster in many cases. The test takes several seconds (more on slow buildfarm animals) because we need quite a few tuples to trigger two rounds of index vacuuming; so it is worth a follow-on commit to speed it up. Suggested-by: Masahiko Sawada Discussion: https://postgr.es/m/CAAKRu_bWmMjmqL%2BOZ2duEQ80u7cRvpsExLNZNjzk-pXX5skwMQ%40mail.gmail.com Backpatch-through: 14, the first version containing this test.
1 parent 0a80e88 commit 9744fe2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/test/recovery/t/043_vacuum_horizon_floor.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
CREATE TABLE ${table1}(col1 int) with (autovacuum_enabled=false);
7171
INSERT INTO $table1 SELECT generate_series(1, 200000);
7272
CREATE INDEX on ${table1}(col1);
73-
UPDATE $table1 SET col1 = 0 WHERE col1 > 1;
73+
DELETE FROM $table1 WHERE col1 > 1;
7474
INSERT INTO $table1 VALUES(1);
7575
]);
7676

0 commit comments

Comments
 (0)