| From: | Nathan Bossart <nathandbossart(at)gmail(dot)com> |
|---|---|
| To: | Robert Treat <rob(at)xzilla(dot)net> |
| Cc: | David Rowley <dgrowleyml(at)gmail(dot)com>, Sami Imseih <samimseih(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jeremy Schneider <schneider(at)ardentperf(dot)com>, pgsql-hackers(at)postgresql(dot)org |
| Subject: | Re: another autovacuum scheduling thread |
| Date: | 2025-11-12 20:10:16 |
| Message-ID: | aRTpqMleDpoQm9OO@nathan |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Tue, Nov 11, 2025 at 06:22:36PM -0500, Robert Treat wrote:
> On Tue, Nov 11, 2025 at 3:27 PM David Rowley <dgrowleyml(at)gmail(dot)com> wrote:
>> On Wed, 12 Nov 2025 at 09:13, Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote:
>> > My concern is that this might add already-processed tables back to the
>> > list, so a worker might never be able to clear it. Maybe that's not a real
>> > problem in practice for some reason, but it does feel like a step too far
>> > for stage 1, as you said above.
>>
>> Oh, that's a good point. That's a very valid concern. I guess that
>> could be fixed with a hashtable of vacuumed tables and skipping tables
>> that exist in there, but the problem with that is that the table might
>> genuinely need to be vacuumed again. It's a bit tricky to know when a
>> 2nd vacuum is a legit requirement and when it's not. Figuring that out
>> might me more logic that this code wants to know about.
>
> Yeah, there is a common theoretical pattern that always comes up in
> these discussions where autovacuum gets stuck behind N big tables +
> (AVMW - N) small tables that keep filtering up to the top of the list,
> and I'm not saying that would never be a problem, but assuming the
> algorithm is working correctly, this should be fairly avoidable,
> because the use of xid age essentially works as a "hash of vacuumed
> tables" equivalent for tracking purposes.
I do think re-prioritization is worth considering, but IMHO we should leave
it out of phase 1. I think it's pretty easy to reason about one round of
prioritization being okay. The order is completely arbitrary today, so how
could ordering by vacuum-related criteria make things any worse? In my
view, changing the list contents in fancier ways (e.g., adding
just-processed tables back to the list) is a step further that requires
more discussion and testing.
To be clear, I am totally for serious consideration of reprioritization,
adjusting cost delay settings, etc., but as David has repeatedly stressed,
we are unlikely to get anything committed if we try to boil the ocean. I'd
love for this thread to spin off into all kinds of other autovacuum-related
threads, but we should be taking baby steps if we want to accomplish
anything here.
--
nathan
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Joel Jacobson | 2025-11-12 20:37:51 | Re: Optimize LISTEN/NOTIFY |
| Previous Message | Arseniy Mukhin | 2025-11-12 19:56:58 | Re: Use streaming read I/O in BRIN vacuuming |