> Good idea. I put my own spin on it in the attached. Please let me know > what you think.
This look OK to me. > > The current scaling calculation for force_vacuum could lead to > > exorbitantly high scores. > > Using DEBUG3 and consume_xids_until(2000000000), notice how the score goes > > from 7.93 to 661828682916018.125 once past failsafe age. > > > > [...] > > > > Do you think it will be better to just to add the age to the > > score? > > I mean, that's kind of the point. Once a table surpasses one of the > failsafe thresholds, we want its score to be so exorbitantly high that > autovacuum is all but guaranteed to process it first. I see no particular > advantage to tempering the score in that case. The main issue is that the scores can reach quadrillions, or even billions, which feels excessive, especially if exposed in DEBUG3 or in a future prioritization view. So scaling the scores down seems like the right thing to do. We could also do this by dividing the score by a large constant, or use log10 to compress the score. Both methods should keep the sort order unchanged. However, If everyone agrees with the current approach, I will not push back further. -- Sami Imseih Amazon Web Services (AWS)
