Fix logic in lazy vacuum to decide if it's worth trying to truncate the heap.
authorHeikki Linnakangas <[email protected]>
Tue, 6 Jan 2009 14:55:44 +0000 (14:55 +0000)
committerHeikki Linnakangas <[email protected]>
Tue, 6 Jan 2009 14:55:44 +0000 (14:55 +0000)
commit84356404c357b03f2a3cba283c44229b95f87bf6
tree96613752d270ff27f1e39ec6f82fd9c52b46be7c
parent98bf81df6eb073373238e9061eef742aa91f6c35
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