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 1v6eYI-007oXd-Ne for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Oct 2025 00:30:38 +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 1v6eYG-00DxJT-AF for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Oct 2025 00:30:37 +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 1v6eYG-00DxJC-0F for pgsql-hackers@lists.postgresql.org; Thu, 09 Oct 2025 00:30:36 +0000 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v6eYE-00184N-2b for pgsql-hackers@postgresql.org; Thu, 09 Oct 2025 00:30:36 +0000 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-76e4fc419a9so385335b3a.0 for ; Wed, 08 Oct 2025 17:30:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ardentperf-com.20230601.gappssmtp.com; s=20230601; t=1759969833; x=1760574633; darn=postgresql.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=rMBByqql1ujh9/8+2PxilYQ+ZXxrJT/wLXtCdJIa43w=; b=lQs2UIDBYdM0V+jnZ5VQ+HUP4OZV2ylcIVUYZ0r/hwAm/fM5pAjru6Fcx34GX1V91t ShFRGO2yJdyxIsPukr0xOZEQ/ZTKGGwtVrF2zPo8gCNBzfdTRkchLszgtP/g+PbbIPqa 0XCuByeg/OAu/C/SoJyVrIpCOMibknDICrYz2DR8YmWOvmdynXNLGBkrmTM1ROJJmrFG 56xQmLSiVuoxWWbZ2Cup97Lkfrbr5L3iViMFSdlqxvWofy75DwaTyqbi6ZcWmcsvXA7x 5HM5fzi6q53/lneDejfg+LyI0NfWrvUldiz5g+RmQBUpxNKa0PLoFvn1wH1ChJ1nzIPm bqew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759969833; x=1760574633; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rMBByqql1ujh9/8+2PxilYQ+ZXxrJT/wLXtCdJIa43w=; b=mrmfmrJhycyHXsYep0JiaXqAbdnoDIZLSN5RGhHwK6XVEs0lUI4LNAO9r+XckYcyBc 7w4TMeIOGvxz3vGzM+ufBS2Yj3mqT6MVThH5DRR6QltQarHq4Lq1ofiE4FXNE+W9ksXy 4NBWON7KDgof7Asw46MV1u9q9M/eqe4JOC5LcZUwetadjPD0pDJ1qe5wnwdGtnWQyf0U gFAbAgmYIq2DyXS4H+jH9yCLNjjXecFLafoeZBVtdhB6NYmP89Ux6aNeS8KwH0Jh+meC 2ymooh/KPcoW0/CAxaGKFFaDvJGe8fB6/tLlBiDDdlh47FmlWFOEzmecf4S2EfC22PU+ z2sg== X-Forwarded-Encrypted: i=1; AJvYcCW/E8m353Pthh8nu2g8mYdAHCkIpGLHrJ60KJhPLyR8r12EiDQIcQyVh0wlYG8yATZjTYkoh5NF+884HleY@postgresql.org X-Gm-Message-State: AOJu0Yz31LiP32Mgsum5G6iv438eujkcdkpQ/SoFlZi5HgTa3RY9eXyN rwcnJ7mv5AeRFiBMxIZ7dYjLEeZDmCmzHgLrvqRwkZtL3H+bucpcBbpHMLWwwBVu+Q== X-Gm-Gg: ASbGnct9hCpIlws2yHtsOSV0nWOx9ZAx2RYFDdSzmgtU+pRHvL19CHD1okfTxIQ4T+i YLW8JDjPBQf1FE3vrciOZzqqJAKRQAWesoUGFBdNsfqbEWGzf0fR5WJe/U4YMOoGcZGcyOqdkwg MqJ2l6Jpanf3UzuJ15SJWb8WyFAK70FGFodIayAgRUToD9QL9OV/5x+aRxloDOC1n9hdb3JjV0P LtjMhnhWld2pEPjFdCxzPfg2Q2HahzhLoIteJz64STntRJLL8ar0JpN1jM2cb0dV/v7sKRx/M3E 7Jb5yyqOrb7+CHevA7T30jn4xrclEGQRqAN+TO4hUSnCzTAEEUC12aWZ3+9TABVWSNzdpM18DKS VqJkGMHOtibYAIQ71qwM9ChApk99xKXvN5PpRPRyjHOI6ri3olB7qGUr0v8MyyqnqRyjl8quMfM Q2+bGFVbev1wmaJDp7A0A4rw== X-Google-Smtp-Source: AGHT+IGvT+yNwTPm0iho5j1l6joT1L0H0DHMFYb4rwu7hps+To/Z37OR0q73b+dBrAVH3jubLvthvA== X-Received: by 2002:a05:6a20:939e:b0:2fb:add5:5583 with SMTP id adf61e73a8af0-32da8133300mr7360380637.24.1759969832906; Wed, 08 Oct 2025 17:30:32 -0700 (PDT) Received: from ardentperf.com (97-113-159-222.tukw.qwest.net. [97.113.159.222]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b6099f3b9c6sm19240341a12.23.2025.10.08.17.30.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Oct 2025 17:30:32 -0700 (PDT) Date: Wed, 8 Oct 2025 17:30:30 -0700 From: Jeremy Schneider To: David Rowley Cc: Sami Imseih , Nathan Bossart , pgsql-hackers@postgresql.org Subject: Re: another autovacuum scheduling thread Message-ID: <20251008173030.2a9322db@ardentperf.com> In-Reply-To: <20251008172727.3befd129@ardentperf.com> References: <20251008164057.6bceb9ed@ardentperf.com> <20251008172727.3befd129@ardentperf.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 8 Oct 2025 17:27:27 -0700 Jeremy Schneider wrote: > On Thu, 9 Oct 2025 12:59:23 +1300 > David Rowley wrote: > > > 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. > > I'm arguing that it works well with autovacuum. Not saying there > aren't going to be certain workloads that it's suboptimal for. We're > talking about sorting by (M)XID age. As the clock continues to move > forward any table that doesn't get processed naturally moves up the > queue for the next autovac run. I think the concerns are minimal here > and this would be a good change in general. Hmm, doesn't work quite like that if the full queue needs to be processed before the next iteration ~ but at steady state these small tables are going to get processed at the same rate whether they were top of bottom of the queue right? And in non-steady-state conditions, this seems like a better order than pg_class ordering? -Jeremy