Comment on SJW - Known issue loading page 2+
cantstopthesignal@sh.itjust.works 5 days ago
Why use a percentage basis instead of a fixed length or percentage + fixed length cut off?
Comment on SJW - Known issue loading page 2+
cantstopthesignal@sh.itjust.works 5 days ago
Why use a percentage basis instead of a fixed length or percentage + fixed length cut off?
Good question. I don’t design these things.
I’m not even an expert on databases.
The way I understand it is that the 50 is a floor.
Makes sense, you probably don’t want to vacuum too often, which might compete with other locked slots and have overall adverse effects.
The work done while vacuuming is proportional to the table size, so vacuuming a small table is small work, while vacuuming a bigger table is more work.
I guess that’s why it’s using a %.
Thing is there’s no upper cap.
Or there wasn’t until postgres 18+, and even then it’s likely way above what we’d run into.
I imagine that it can make sense for many tables and the default might be conservative as to avoid the drawbacks of over vacuuming.
Even an upper cap would only shorten the amount of time before it fixes itself.
In our case, the issue was mostly due to the database upgrade which basically resets the counters towards the next run.
I’ll probably just add a daily job that takes care of this more gracefully without being too agressive.
Regardless, this should probably be added to the upgrade process.