Fix logic in lazy vacuum to decide if it's worth trying to truncate the heap.
authorHeikki Linnakangas <heikki@enterprisedb.com>
Tue, 6 Jan 2009 14:55:37 +0000 (14:55 +0000)
committerHeikki Linnakangas <heikki@enterprisedb.com>
Tue, 6 Jan 2009 14:55:37 +0000 (14:55 +0000)
commit39c4f9ac22db51ead2be750924967467bdfa49d6
treef3ab04442a90fe6b862d24d8cc54c5a92c82d2f5
parent1b826c270f2710b0da968a9a33d30fb5907565a6
Fix logic in lazy vacuum to decide if it's worth trying to truncate the heap.
If the table was smaller than REL_TRUNCATE_FRACTION (= 16) pages, we always
tried to acquire AccessExclusiveLock on it even if there was no empty pages
at the end.

Report by Simon Riggs. Back-patch all the way to 7.4.
src/backend/commands/vacuumlazy.c