From: Robert Haas [mailto:robertmhaas@gmail.com]
> Unfortunately, I think a full solution to the problem of allocating AV
> workers to avoid wraparound is quite complex.
Yes, that easily puts my small brain into an infinite loop...
> Given all of the foregoing this seems like a very hard problem. I can't
> even articulate a clear set of rules for what our priorities should be,
> and it seems that such rules would depend on the rate at which we're consuming
> XIDs, how close we are in each database to a wraparound shutdown, what tables
> exist in each database, how big the not-all-frozen part of each one is,
> how big their indexes are, how much they're holding back relfrozenxid, and
> which ones already have workers, among other things. I think it's quite
> possible that we can come up with something that's better than what we have
> now without embarking on a huge project, but it's not going to be anywhere
> near perfect because this is really complicated, and there's a real risk
> that we'll just making some cases better and others worse rather than
> actually coming out ahead overall.
So a simple improvement would be to assign workers fairly to databases facing a wraparound risk, as Sawada-san
suggested.
One ultimate solution should be the undo-based MVCC that makes vacuuming unnecessary, which you proposed about a year
ago...
Regards
Takayuki Tsunakawa