Save a few cycles during nbtree VACUUM.

Peter Geoghegan <pg@bowt.ie>

Commit: 7bb97211a5589265f3f88183ae9353639ab184c6
Author: Peter Geoghegan <pg@bowt.ie>
Date: 2021-03-11T22:18:23Z
Releases: 14.0
Save a few cycles during nbtree VACUUM.

Avoid calling RelationGetNumberOfBlocks() unnecessarily in the common
case where there are no deleted but not yet recycled pages to recycle
during a cleanup-only nbtree VACUUM operation.

Follow-up to commit e5d8a999, which (among other things) taught the
"skip full scan" nbtree VACUUM mechanism to only trigger a full index
scan when the absolute number of deleted pages in the index is
considered excessive.

Files

PathChange+/−
src/backend/access/nbtree/nbtree.c modified +5 −9