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 1v6tHA-00BOrr-Tk for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Oct 2025 16:13:56 +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 1v6tH8-007Adq-LU for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Oct 2025 16:13:55 +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 1v6tH8-007Adi-CE for pgsql-hackers@lists.postgresql.org; Thu, 09 Oct 2025 16:13:55 +0000 Received: from mail-io1-xd30.google.com ([2607:f8b0:4864:20::d30]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v6tH7-001GPO-0f for pgsql-hackers@postgresql.org; Thu, 09 Oct 2025 16:13:54 +0000 Received: by mail-io1-xd30.google.com with SMTP id ca18e2360f4ac-92b92e4b078so46855139f.0 for ; Thu, 09 Oct 2025 09:13:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760026431; x=1760631231; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=CYZ+Fwyhf5gy8SwdOXKWpdmhLN0nOFx8pcqu7kuL/Gc=; b=WOoQcJr9Kl6ppsMYFGzwzGM7gPqJTkSM6Z8MZlPjseYdKUJXetCe1LEwUF0WRbEUL8 ZhNvUmgvWbV0+qVNjJbhm8rEBlxG6k8hSWN58inRe3WckHChW0Pg+a0APddGShYUi1fS 9gk1LB957Aars6j9IXr3DXgu8Txt5a1eDhXK8MoBsLx1DK4vo8+eOz6JqSx8LynfdMng UK5vH3AC0VnfgIRr/8GcJENEh2kLj8aQwpv59cYaw592YLMyYbOWeHNyz/RScBJRBrk9 sSBCuLtGFQSJxCBFb/S1WSOKW9OhXI45JITn97jpyKGC9ah+O9sepMABhbhQDLRuFTWS 9BMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760026431; x=1760631231; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=CYZ+Fwyhf5gy8SwdOXKWpdmhLN0nOFx8pcqu7kuL/Gc=; b=UtFMXw8y4srw3wylyl8r03UK+bfAc0vdy2dWCAZmqUIz3aIg6R50yFB7noKurt5kPW 7W1DLp7B42jy8yUMtftIImshqKtjOK38BvtmE52K7izmrAhAuNDqTuqA/v4ybi8Ozg0e Mc5pB3YsphqqBqSsR6oHxMRx9ulXlPuU7tiZZMgIxRNPws0oU3HovQVFLNDrEQ9hSXCb hfvvUpIi62uFWxu/H1d4a+De2eUkZF+5qhnRvfH3C+/jbDxWO9/a+dvmaaD/5Gj+rMZ0 d8YkINt8wLh2zUChVaZZXdGIlQaK3Eyhs61gKbrzRZ3CWxRxV5yIcxVZHmMLifXCCu2z YQIA== X-Forwarded-Encrypted: i=1; AJvYcCUZBoEwzT8Y2L6FjYT0ZXeAiZFgoy2rAwtZL3KFdNslPLVHfE6bB5xs3cChsJ+d1IbHNujl3k8642jkzIYE@postgresql.org X-Gm-Message-State: AOJu0Yx0df/0KKQ27XY5VSscTptX9RfLiTfx6dbV29DJK7ZvLGMpCJSs Bek53v6ymLfIrrTkozTrs8jUMrfEZ3FW9WWEUBiD2BOaYb8EN99qDycB X-Gm-Gg: ASbGncs9DoqKNh9G4hYlqLbVimvNMLHdu8rc4rpAcHqgsZuutB+c/BAJeEJK6ImopQh 5P7Dcskz1TX+B45gGt/2Sz6fn+hzf7xc+27UV3maWZiCJtInE6K6Vo9p69Uon04Xx2/QJ/09Kx8 LYrItz6kF43HxpfbwdtDFgy5+GCjOkn1NtX/ikvHBR2puFntyDC/2danqpw0PLghX/tFbGTs5Fk bQdjzI1g0Abosqb5Rfq7QMMpRnAsrc31lRsqd/MW1lgTrA5xKso5yUpBaMMai0dkX/pidj82rWZ AfqA+3+qoXUFvU0SdX6gOyhRQtw6fyZUreURchG6Fn16WXri6TDgAxlF0Ta9VgRi3xDEhmOWr+r eQOtFShEclFUqgL1iUUImVICP39KZUu6plwDlrNuyvWxal+ciR0EgfcK3C62ClukTAG4KsOsha8 j9AJgyizgPsu+eXWz5/NgAiIOLTVXALg3o8b7x0JXFxP5UCJI= X-Google-Smtp-Source: AGHT+IHcxqEEP8pzcZAq157lxk3JTsRljblIdO4pWzwoa5b1gduQysmh5BfzIgNedjUPHLyyG6fsdg== X-Received: by 2002:a05:6e02:1fe3:b0:42f:95a1:2e8 with SMTP id e9e14a558f8ab-42f95a104bfmr14857215ab.24.1760026430900; Thu, 09 Oct 2025 09:13:50 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-42f90107a3fsm11681735ab.0.2025.10.09.09.13.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Oct 2025 09:13:50 -0700 (PDT) Date: Thu, 9 Oct 2025 11:13:48 -0500 From: Nathan Bossart To: David Rowley Cc: Jeremy Schneider , Sami Imseih , pgsql-hackers@postgresql.org Subject: Re: another autovacuum scheduling thread Message-ID: References: <20251008164057.6bceb9ed@ardentperf.com> <20251008172727.3befd129@ardentperf.com> <20251008182520.6e05a8b8@ardentperf.com> <20251008184740.328d45de@ardentperf.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Oct 09, 2025 at 04:13:23PM +1300, David Rowley wrote: > I think the best way to understand it is if you look at > relation_needs_vacanalyze() and see how it calculates boolean values > for boolean output params. So, instead of calculating just a boolean > value it instead calculates a float4 where < 1.0 means don't do the > operation and anything >= 1.0 means do the operation. For example, > let's say a table has 600 dead rows and the scale factor and threshold > settings mean that autovacuum will trigger at 200 (3 times more dead > tuples than the trigger point). That would result in the value of 3.0 > (600 / 200). The priority for relfrozenxid portion is basically > age(relfrozenxid) / autovacuum_freeze_max_age (plus need to account > for mxid by doing the same for that and taking the maximum of each > value). For each of those component "scores", the priority for > autovacuum would be the maximum of each of those. > > Effectively, it's a method of aligning the different units of measure, > transactions or tuples into a single value which is calculated based > on the very same values that we use today to trigger autovacuums. I like the idea of a "score" approach, but I'm worried that we'll never come to an agreement on the formula to use. Perhaps we'd have more luck getting consensus on a multifaceted strategy if we kept it brutally simple. IMHO it's worth a try... -- nathan