Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vIvDm-002rzN-0V for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Nov 2025 20:44:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vIvDj-007jhX-1O for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Nov 2025 20:44:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vIvDj-007jhN-0P for pgsql-hackers@lists.postgresql.org; Tue, 11 Nov 2025 20:44:07 +0000 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vIvDc-006bVw-30 for pgsql-hackers@postgresql.org; Tue, 11 Nov 2025 20:44:06 +0000 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-59578e38613so5150e87.2 for ; Tue, 11 Nov 2025 12:44:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1762893839; x=1763498639; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=I2FHoR15nnSk4VA0xlrlyowN+3/bisRcykWzSgBZpQQ=; b=dh9o7s6oUZEUE05kQkW/nSa8Tf6LzYWMmMRbozI6DAG0AU0+Sj0JKqtFyMeFHLz32U HiLv5xih/OcWoRIRVICIDB4KbvxPSpoXmsKqoX7yPpfIZpqjP6IhPY7GjI9GiocybZ5r 3QiLiuBr9xmr17KFHkDU+COigCmTyVEN8IgZ2ET9pZcmCfdNh7BwXCEAvFdn1KBoOhWj xVpXpzIwxmo7rrTlV0UDKDhTEUqzXb0usKHk4dYWv/OfFw9SLUO+kHkSFtfA9UXoPjjR 9+uQtJQHEW0QVaCrpHKNYe/+Red4p6TF0ZxTyGiO7dJvWh061YSEF/goa+HPqhUY19sJ OByw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762893839; x=1763498639; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=I2FHoR15nnSk4VA0xlrlyowN+3/bisRcykWzSgBZpQQ=; b=Jkoy7x8Ns8OUZFkCOArR4lM8TJfmTzeCnhV4Snq5vWNnR9daSajolH5sFutqoTbfXd f+B4+p5piNQMiF6AfDyk2Xe3jpCuwQeO9qZ8ZOlMO5e5uaUOPFfZ39xvFegH+wZ74+zn DennzGMavxDORaRihc723DtM2UmgUwBhkUiqOzw5rl/e5oFNdah6xIvr5lhD34iATHEX Yu/vTsEMERn4kIZWBl4Mc08W6idQZEfWt3FYcNOwQZgxRx3lFGEX8P1KQzBG483ZPhT7 4xyiQ8+HKMtHU7q+1vladctKE9z4SLBlCK1tBEJrX81WfKeN1clWZZKjLu06OSaDpicR r2YQ== X-Forwarded-Encrypted: i=1; AJvYcCWSTIL55tlm+S8sdNWvaqujQ3NgV0mUYx7eXp5eNJ/980bOvfi8rsB+4JKfN2T5WsrFN3t5cb6skKQd7/DO@postgresql.org X-Gm-Message-State: AOJu0Yy0CwFmIX8L2XIBDw+87ylYTQmQw88BvaehRDTFHd0eaVfvjfdo RviQuDNhESQ5ObRXGIa/SH1AhAjrGIJ97q5h96bsQzWloF16fYZcw6RQUaYw/K/B4hW5eEg2Tq+ Npu4VzSB/LFIVherm1ISph0TL5K9RoSs= X-Gm-Gg: ASbGnctDCyglJfRbVXTw4hvN5M+NcIoFMSBQJRJ5WG+0xMBDgIX0wNqxzqv7UiFFBvc gi5BaAHFHa1eJdCccYjb8XGONhZ6+uccXP+3e+vHyGkaOAoVOb22L7rBQJFgpD5gQx0hr7QtkvT /u4J75pS44xu0deIx+EmStA1nntIbDDeG4tj62zuuEn+c8BsKY16TiiUtg74/sf6h4egoDglAfd 50ZR8TmkpPtDpywuOCCD0kI4N/hVry0gbONIDq5rsRaPSf8j1S0F5ZL12/Dec1TU74JY9TpKFsP 5o9SjCx55cl5lgncF15xmu15OgxCeT8vs/kmoaiDlUF/LW1mNXUDAObxsTCQyw== X-Google-Smtp-Source: AGHT+IEsSRlZAsDjrSTmORCKzeMz9LdaG3irkgtFqXdfd6U0ui2tPv5EnSGjG1lIhRwdvBinQ0LxtycV0JXMm7o2An8= X-Received: by 2002:a05:6512:2246:b0:594:1957:a36b with SMTP id 2adb3069b0e04-59576df31f3mr179314e87.2.1762893839128; Tue, 11 Nov 2025 12:43:59 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: David Rowley Date: Wed, 12 Nov 2025 09:43:46 +1300 X-Gm-Features: AWmQ_blaDuF056DmdAACY8HagNv8wgfVQHdGHFpZ29KdX0aRw6AK7WBD3St-kzo Message-ID: Subject: Re: another autovacuum scheduling thread To: Sami Imseih Cc: Nathan Bossart , Robert Haas , Jeremy Schneider , pgsql-hackers@postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 12 Nov 2025 at 09:25, Sami Imseih wrote: > The thing I=E2=80=99m hoping to address is something I=E2=80=99ve seen ma= ny times in practice. > Autovacuum workers can get stuck on specific large or slow tables, and wh= en > that happens, users often end up running manual vacuums on those tables > just to keep things moving for the smaller/faster vacuumed tables. > > Now, I am not so sure any type of autovacuum prioritization could actuall= y > help in these cases. What does help is adding more autovacuum workers. Thanks for explaining. I think the scoring system in Nathan's patch helps with this as any smaller table which are neglected continue to bloat, and because they're smaller, the score will increase more quickly, and eventually they'll have a higher score than the larger tables. I think the situation you're talking about is when *all* autovacuum workers are busy with large tables and no workers remaining to deal with the now-higher-scoring smaller tables and they bloat severely or statistics become wildly outdated as a result. I'm aware of that problem. It seems to happen mostly when large tables are busy receiving an anti-wraparound vacuum. I'm not sure what to do about it, but I don't think changing the scoring system is the right thing. Maybe we can have it configurable so that 1 worker can be configured to not work on tables above a given size, so there's at least 1 worker that is less likely to be tied up for extended periods of time. I don't know if that's a good idea, and also don't know what realistic values for "given size" are. David