Fixes #8316: Removing a host can create a huge transaction