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 1vIvNY-002yjn-1g for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Nov 2025 20:54:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vIvNW-007no6-05 for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Nov 2025 20:54:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vIvNV-007nnw-2M for pgsql-hackers@lists.postgresql.org; Tue, 11 Nov 2025 20:54:13 +0000 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vIvNQ-007DXx-0y for pgsql-hackers@postgresql.org; Tue, 11 Nov 2025 20:54:13 +0000 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-64080ccf749so158911a12.2 for ; Tue, 11 Nov 2025 12:54:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1762894447; x=1763499247; 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=2wLcVz/rVoY1IWgHs0Xn4pRAhrsKFfc8juFVgHv8HQ4=; b=Z1au4H95M2LtBb4PSoi7oYYB4XHefAJpeK+tB80+YXV1A+L/UdufM8Rec0f/HE7ZTB G73K8ahN9Drnvgk3h0c931ie/QFlRx9BMycjDIeX5eghMxtLh+Ie6Tsou8gh21/n8P3E +OjXyOn16Udq5Hd/MzgH4/jXpgtTyGORomAd6KgyzevOcGpIIWW3/wLzX4RT3xFlzXXJ rpm6hcSjOzneOr624NuzaOM+TSbRrqRdDjxBrPaTlHvh7HKkTsvrnCGl52Xf2v3wag0f TUNvCuNJuPdQEQMBwlKlNSUQNtk6RH6aCp35ZsphZofY2YGUNxnRKQHQk1VBSo1xtDUI 3NRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762894447; x=1763499247; 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=2wLcVz/rVoY1IWgHs0Xn4pRAhrsKFfc8juFVgHv8HQ4=; b=CDIkIeQ6aQ7NINmukCzeQxNL2j6aacdPpeA/gTPlddMN4j4OT2W+Kbe2/kshFfxYzB Sd2kv5rnIl/5Ldu0SbOvQDTYm6KND9nj42x5RewcK0Tfdn2o/GtkQxdtU2OUOTd3pNEo jbqihqt7gSPMsm4zv7+phvDop1J6EMGFCEnHRGu2AF/TywiqbMmA+2KdnU/HsHJIBa6J RSNAz64HB8vRrZrRa4dL3BJ0UsBDbQAj71DrScdX/wwz059//mQYy8rKPt7MrWBG7Zzn p1VUHnXkZiuDQBX41QUT21XecGK5pV30tAmutXXgs/D3tofyXYxSucunE9XyzwaDCaR5 8PoQ== X-Forwarded-Encrypted: i=1; AJvYcCWXmxir0eyl8uevpMxsoq/q1U+f8MW1SYU+U06yk0p80gZrXcoWutoHsWdlDGi5c/OjEmwX+p/k2GdxyqXh@postgresql.org X-Gm-Message-State: AOJu0Yxh0B39pDIr1X/c3uM4afCBQOijOFhM4XpSxHxRoymm9tWDVUYn +88XqlKKRdh+XeREjTuDkMzH4mz7jS1iWmu73ESWsEt8dGSgfp2ZUWrKagK67s3fGxqq8c6Qw2h AatTVQenMpyIC8JZwqOuuXa9ut/yUk+k= X-Gm-Gg: ASbGncs2pIhoXEqwHrSKSE4LcyKfpFXSX6bT4OX+/ZgTwRVHrmJZq518uCUGXR0883g hA+xv5uTlvXPzeGLAiEdnNTkadshBHE0iULPSNj6otrSLVk+YWM10gWx2sPXPbHEVUtWszD57te W+fCKJPvYXfd3+FO2O0XwkBRYx9YIEXIAncQNM3SQbzhuduXhtfsitcuJxNQsjQ5dfgffb4/6PB zTtdPQdli/6QqgJ8GGlf5zos5p2Tp2YinsZM9Pw3sz1pHQpsGRKeebD X-Google-Smtp-Source: AGHT+IFyjskl5F6QWpITvEG1qzED5ZIxUjDS0I0MSbVqLsYLEsZ68CJcT6Bf2kMQpkgyog2LGgxS2JTJkCAG5DeQlKs= X-Received: by 2002:a05:6402:5245:b0:640:c3c4:45f3 with SMTP id 4fb4d7f45d1cf-6431a395f28mr547429a12.6.1762894447183; Tue, 11 Nov 2025 12:54:07 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Sami Imseih Date: Tue, 11 Nov 2025 14:53:55 -0600 X-Gm-Features: AWmQ_blpFe7NmZMCI8m5RyWcCz__vlfQCLdj5B7CqOhD4JBmWk0dGf49RDTNPnE Message-ID: Subject: Re: another autovacuum scheduling thread To: David Rowley 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 > > The thing I=E2=80=99m hoping to address is something I=E2=80=99ve seen = many times in practice. > > Autovacuum workers can get stuck on specific large or slow tables, and = when > > 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 actua= lly > > 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, That is true. > 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. Another approach will be to signal for more autovacuum workers to be spun up ( user can have a minimum and max workers ) if all workers has been processing the list for a long time ( Also not sure what the long threshold would be ). This "auto-tuning" of workers could perhaps reduce the need for manual vacuums. It will still not prevent all workers from being tied up, but maybe reduce the likelihood. -- Sami