The scan only performs one backend local bool write per pending entry, so this is probably negligible compared to the actual flush work. A pass generation could avoid the extra scan, but I'm not sure that would be worth the additional complexity.
What do you think?
The scan only does one backend-local write per pending entry, so it is negligible compared to the flush work itself. I benchmarked a workload touching 1, 2, 4, 8, ... up to 512 empty relations per transaction across 1, 2, 4, ... up to 256 clients, and did not see any
differences beyond noise of +/-1% tps differences.
Even so, I think the pass-generation approach is the better idea here. It's
slightly more code, but it avoids the extra full-list reset pass. I will feel