diff options
author | Melanie Plageman <melanieplageman@gmail.com> | 2024-07-29 15:36:55 -0400 |
---|---|---|
committer | Melanie Plageman <melanieplageman@gmail.com> | 2024-07-29 15:42:10 -0400 |
commit | 9744fe24118ba5738dda9008533ed00227f5d069 (patch) | |
tree | b834bae2ec41604bc233e6b740b7b8c40229ac52 /src | |
parent | 0a80e88d902d3dfdeed03ede1880b8994a8d892b (diff) | |
download | postgresql-9744fe24118ba5738dda9008533ed00227f5d069.tar.gz postgresql-9744fe24118ba5738dda9008533ed00227f5d069.zip |
Use DELETE instead of UPDATE to speed up vacuum test
e2e992820f104def 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.
Diffstat (limited to 'src')
-rw-r--r-- | src/test/recovery/t/043_vacuum_horizon_floor.pl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/recovery/t/043_vacuum_horizon_floor.pl b/src/test/recovery/t/043_vacuum_horizon_floor.pl index 5959019393d..51b65048ee3 100644 --- a/src/test/recovery/t/043_vacuum_horizon_floor.pl +++ b/src/test/recovery/t/043_vacuum_horizon_floor.pl @@ -70,7 +70,7 @@ $node_primary->safe_psql($test_db, qq[ CREATE TABLE ${table1}(col1 int) with (autovacuum_enabled=false); INSERT INTO $table1 SELECT generate_series(1, 200000); CREATE INDEX on ${table1}(col1); - UPDATE $table1 SET col1 = 0 WHERE col1 > 1; + DELETE FROM $table1 WHERE col1 > 1; INSERT INTO $table1 VALUES(1); ]); |