Hi,
I noticed that in lazy_scan_heap(), when there are no indexes on the
table being vacuumed, we don't release the lock on the heap page buffer
before vacuuming the freespace map. Other call sites of
FreeSpaceMapVacuumRange() hold no such lock. It seems like a waste to
hold a lock we don't need.
ISTM the fix (attached) is just to move down the call to
FreeSpaceMapVacuumRange() to after we've released the lock and recorded
the space we just freed.
- Melanie