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.94.2) (envelope-from ) id 1v6e4Q-007jZP-J0 for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Oct 2025 23:59:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1v6e4N-00Doup-Te for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Oct 2025 23:59:44 +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.94.2) (envelope-from ) id 1v6e4N-00DouF-HU for pgsql-hackers@lists.postgresql.org; Wed, 08 Oct 2025 23:59:44 +0000 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v6e4H-0017qk-0X for pgsql-hackers@postgresql.org; Wed, 08 Oct 2025 23:59:39 +0000 Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-36c0b946cb5so2563331fa.3 for ; Wed, 08 Oct 2025 16:59:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1759967976; x=1760572776; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=t+YSBKw7OY+DwHuOlBIv8rTL5l9ac1Cbi006Z2g9pY4=; b=ZLRceyYv5gd20pyAflW4nEEklUXt7IK+yJwFt0/VhBomkmmDEXCkNowjD17dvwXIu4 RRo8E9p4nY0sbs+4UhAM/FjKwJ2nOUQlYkQ93L8oJw2bmmKfrO4thYfCOP2n/Va5+L9c dMiXO9iW2qT7be7ZG6udj0O2ThiSbu91ARBIcNFFpU09Q7vry3Yo7d0k+TizQ5Y/O8aD BVFTBS+Zt+nroK2RR+W31auwzn9fFGu9anMENcs2isxlsZ3Gej+1JdjMKSKnR5QhSI9I 81SYUsc3NQaE/pEwH7zK1GjqkCMut7MknXPlZQq1lbZlCZAhzk6B//m05I4O1ltgBkp0 OY4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759967976; x=1760572776; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=t+YSBKw7OY+DwHuOlBIv8rTL5l9ac1Cbi006Z2g9pY4=; b=RY4YcBTZq/ozFsZuGhEmars/3oUfS0fGQrMoNRQrcOMo/01xxsJ0p9AkL8QmaTcHAz 1Vi4kLqQAlNEF0gLN69kGGqwGloBpyI/AtXsnCyvWjcqVTOIXFq7D4Yf5y/OAnnoAl2b V4Wf3D/QEYz50O00ayNCNDI3T0cOWrFmjqsmcmmPFqiOrBCdAHnVdJ2E/gDygeEFSYjH dZHJfbXSEEEg86esdBNdPw6K5rMEKAFnTsN9Ji1yyIMZevWkifIENiKa56RHjlNkHeeu fpYO8I8k2E4Fw/NJLIEEp4QffPDF08NcWF4yBvNjVJ5I373wX8MdrWF0ELtVwJV2B3HP 9P2A== X-Forwarded-Encrypted: i=1; AJvYcCXsw1ik/BzKB+VoAlnzFFnW/Q1SMuBA3Tg6Mhbl6idt1eH4nknWbzAOglDBTOne1y8PlLKXhFDTnJqzE3UR@postgresql.org X-Gm-Message-State: AOJu0Yzc95StwYyf8r8H/r1vRm4SqINlLwReB2GQocQ8W97Dpc5s7fBM 4YMxR7GPaw4H+6Yh30gXHgprSZkcezzl4t3iQd8hZYXaD3tA43bNXRwZX9lewpQocdx5GBCxVoZ pwfzFyjDm8MBBEmm6OyTwzPi9s3PIlw4= X-Gm-Gg: ASbGncs35hXbels/IBAsWttYRI5jlGWUyBTxnJFkbarb4MVglxDTDQIrPoA0y+3UcGG eGuRoXmuO8yM2UdfcE1rpFNXcDGKXD5SY0tzKbci9rpYGsQrLnjmz40y0+Y6oBHGcbUwUq3Hz07 DZ1gShmW3b6+uCg66lHzfM2pj5ooZPXMpB2LOxDER+V5s/iSNYKpC/8V9N22rwSb3Jx2UvYh0Am VlqQ2UBNoxWBofOiupWXpejrgQm6X7bbDoyba9tC4NvTDruO9AYWhsrRu/bWmZ5O+vTJsH1ZQeu tNNU6KfVaB8EeKlcPEW3FA== X-Google-Smtp-Source: AGHT+IEQM85m+MwmMrFZuRqAkutNEgfjGpL8zZBT4HoKRPAqzlPqqbFu3R8wcONNQKs84yRQCNdXxrUPZInVp8Ity4s= X-Received: by 2002:a2e:a912:0:b0:36c:595a:74c9 with SMTP id 38308e7fff4ca-37609ce6366mr17134951fa.4.1759967976211; Wed, 08 Oct 2025 16:59:36 -0700 (PDT) MIME-Version: 1.0 References: <20251008164057.6bceb9ed@ardentperf.com> In-Reply-To: <20251008164057.6bceb9ed@ardentperf.com> From: David Rowley Date: Thu, 9 Oct 2025 12:59:23 +1300 X-Gm-Features: AS18NWBt6zagIj8l_FpgacJQq6fUmRlxbCxO05vcEwofnO-16OorhBC2fo-0I2I Message-ID: Subject: Re: another autovacuum scheduling thread To: Jeremy Schneider Cc: Sami Imseih , Nathan Bossart , pgsql-hackers@postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 9 Oct 2025 at 12:41, Jeremy Schneider wrote: > I think an approach of doing largest objects first actually might work > really well for balancing work amongst autovacuum workers. Many years > ago I designed a system to backup many databases with a pool of workers > and used this same simple & naive algorithm of just reverse sorting on > db size, and it worked remarkably well. If you have one big thing then > you probably want someone to get started on that first. As long as > there's a pool of workers available, as you work through the queue, you > can actually end up with pretty optimal use of all the workers. I believe that is methodology for processing work applies much better in scenarios where there's no new work continually arriving and there's no adverse effects from giving a lower priority to certain portions of the work. I don't think you can apply that so easily to autovacuum as there are scenarios where the work can pile up faster than it can be handled. Also, smaller tables can bloat in terms of growth proportional to the original table size much more quickly than larger tables and that could have huge consequences for queries to small tables which are not indexed sufficiently to handle being becoming bloated and large. David