Hi, I was looking at [1], wanting to suggest a query to monitor what autovacuum is mostly waiting on. Partially to figure out whether it's mostly autovacuum cost limiting.
But uh, unfortunately the vacuum delay code just sleeps without setting a wait event: void vacuum_delay_point(void) { ... /* Nap if appropriate */ if (msec > 0) { if (msec > VacuumCostDelay * 4) msec = VacuumCostDelay * 4; pg_usleep((long) (msec * 1000)); Seems like it should instead use a new wait event in the PG_WAIT_TIMEOUT class? Given how frequently we run into trouble with [auto]vacuum throttling being a problem, and there not being any way to monitor that currently, that seems like it'd be a significant improvement, given the effort? It'd probably also be helpful to report the total time [auto]vacuum spent being delayed for vacuum verbose/autovacuum logging, but imo that'd be a parallel feature to a wait event, not a replacement. Greetings, Andres Freund [1] https://postgr.es/m/CAE39h22zPLrkH17GrkDgAYL3kbjvySYD1io%2BrtnAUFnaJJVS4g%40mail.gmail.com