Commit 64ae420b authored by Andrew Gierth's avatar Andrew Gierth

Repair test for vacuum reltuples fix.

Concurrent auto-analyze could be holding a snapshot, affecting the
removal of deleted row versions.  Remove the deletion to avoid this
happening.  Per buildfarm.

In passing, make the test independent of assumptions of physical row
order, just out of sheer paranoia.
parent 88e66d19
...@@ -3,7 +3,6 @@ Parsed test spec with 2 sessions ...@@ -3,7 +3,6 @@ Parsed test spec with 2 sessions
starting permutation: modify vac stats starting permutation: modify vac stats
step modify: step modify:
insert into smalltbl select max(id)+1 from smalltbl; insert into smalltbl select max(id)+1 from smalltbl;
delete from smalltbl where id in (select min(id) from smalltbl);
step vac: step vac:
vacuum smalltbl; vacuum smalltbl;
...@@ -14,23 +13,22 @@ step stats: ...@@ -14,23 +13,22 @@ step stats:
relpages reltuples relpages reltuples
1 20 1 21
starting permutation: modify open fetch1 vac close stats starting permutation: modify open fetch1 vac close stats
step modify: step modify:
insert into smalltbl select max(id)+1 from smalltbl; insert into smalltbl select max(id)+1 from smalltbl;
delete from smalltbl where id in (select min(id) from smalltbl);
step open: step open:
begin; begin;
declare c1 cursor for select * from smalltbl; declare c1 cursor for select 1 as dummy from smalltbl;
step fetch1: step fetch1:
fetch next from c1; fetch next from c1;
id dummy
2 1
step vac: step vac:
vacuum smalltbl; vacuum smalltbl;
...@@ -48,7 +46,6 @@ relpages reltuples ...@@ -48,7 +46,6 @@ relpages reltuples
starting permutation: modify vac stats starting permutation: modify vac stats
step modify: step modify:
insert into smalltbl select max(id)+1 from smalltbl; insert into smalltbl select max(id)+1 from smalltbl;
delete from smalltbl where id in (select min(id) from smalltbl);
step vac: step vac:
vacuum smalltbl; vacuum smalltbl;
...@@ -59,4 +56,4 @@ step stats: ...@@ -59,4 +56,4 @@ step stats:
relpages reltuples relpages reltuples
1 20 1 21
# Test for vacuum's handling of reltuples when pages are skipped due # Test for vacuum's handling of reltuples when pages are skipped due
# to page pins. We absolutely need to avoid setting reltuples=0 in # to page pins. We absolutely need to avoid setting reltuples=0 in
# such cases, since that interferes badly with planning. # such cases, since that interferes badly with planning.
#
# Expected result in second permutation is 20 tuples rather than 21 as
# for the others, because vacuum should leave the previous result
# (from before the insert) in place.
setup { setup {
create table smalltbl create table smalltbl
...@@ -18,7 +22,7 @@ teardown { ...@@ -18,7 +22,7 @@ teardown {
session "worker" session "worker"
step "open" { step "open" {
begin; begin;
declare c1 cursor for select * from smalltbl; declare c1 cursor for select 1 as dummy from smalltbl;
} }
step "fetch1" { step "fetch1" {
fetch next from c1; fetch next from c1;
...@@ -37,7 +41,6 @@ step "vac" { ...@@ -37,7 +41,6 @@ step "vac" {
} }
step "modify" { step "modify" {
insert into smalltbl select max(id)+1 from smalltbl; insert into smalltbl select max(id)+1 from smalltbl;
delete from smalltbl where id in (select min(id) from smalltbl);
} }
permutation "modify" "vac" "stats" permutation "modify" "vac" "stats"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment