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 1vIciY-007pAb-0i for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Nov 2025 00:58:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vIciV-003LQR-29 for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Nov 2025 00:58:39 +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 1vIciV-003LQI-1A for pgsql-hackers@lists.postgresql.org; Tue, 11 Nov 2025 00:58:39 +0000 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vIciS-0074Y4-2u for pgsql-hackers@postgresql.org; Tue, 11 Nov 2025 00:58:38 +0000 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-59447ca49afso4295471e87.1 for ; Mon, 10 Nov 2025 16:58:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1762822715; x=1763427515; 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=MV262PNeKAcRjWfHfhQOYkCm2gzKeGep5KK/RBV5C1M=; b=lsHKPtBFYTLH4LqnKdyzy/AuJn3kQRUgMbi+Yh5Gkp5kpYZqwDNfdhAjBJiaVnWDmD DOZr6zXeT16rMv0TpBU03G6BYyMrjUpy8Nwnq+oHKkOKnoXasSEobeq12DPQVq1hsnbj XqqDT0Qy0JLpeOKiXRDcqcOnppSUT54Eq8q6aLWDdhtIyj8K/vcqqWRQamsN3+JDH3DF 9GwqF6M1349cHCY0DkqmcP5lXDzamRioC6YrFGaxw2VLTY0ACHz7nySLNliez/6zWtvv FT09wOAS2MYlWeBlg5f6FY9CthBySBek6vbCHFz0L8CvQpi/vC3QDECMawveL5xVefdu uyTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762822715; x=1763427515; h=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=MV262PNeKAcRjWfHfhQOYkCm2gzKeGep5KK/RBV5C1M=; b=iqAnTLEvZYzRgOy8uyUFrX07/5JNixHnttvh2Kkjotj95U/YKawuGXHTrjIgCGG6cF /15jk6EG487X0tAkMCzFbkrGjHKhIg/DoMK6hMZXC3x51Y2knXJ/e5Ta4PgHra6I2tJI bGDNSvTXE0hPMeqGNK5kQCvMgszel2B8aTs4i9pKhHKFv2vmiB69iXcNSdo7w51/vJR3 iu96iQjLZeDwIt3KPR2YG0bd+0pDXC/ewJhLTPTcmCi08Iw+Gj5aX8HNwkFkxkDQs8o/ 7UJCMLc8t+ODwQfhv+1LFopih0uLU/1z9LBlyEbKDCnEQ/lgAUGOaf7A2ZPvlM+DG3Bm Tdow== X-Forwarded-Encrypted: i=1; AJvYcCV21EvG/f03tdEpvEqWwDWoHInuPno5h1/gJWqaCpe+s9auzgJq2TjUvw2C8gONHhuIXmHSJX9XaGKkeqSo@postgresql.org X-Gm-Message-State: AOJu0YxAZ2dW8dRZ4UPrd434IsEGLihAhDWWWtQoHuAfnS5xnXusLyWY HtJ8z7kyaK/WfDYi2fBuzUd2PgtVZyk29SiK0x1I81SaaIHRKqvdo0aXTBu3KSS29yyQJOwL889 K0dWIjdMzHdyd2e7Dry9Xz4voD9lUiqw= X-Gm-Gg: ASbGncu+NoahweTEIieM4yotfPhF5vkf5XQMFAubIDkd/hBtWrgUhNdMYChgbh91VjZ t0Ix4V7LAL2s5W3y/wCZNfwfSNsXoY5joUYV8iWeqddYbmr8/3el9O0fF+OUsO2d6goWOCh+8ZS Sslx6c0ZtuNwm6z2FTFFDez/qm/zgJeD/Orb8hUQo9qul89vJgSyFX5ChEMVUz1tIfte58ljlKF jLpLOw7pe7vwA/J4bSL86mBHSecm7Ppye/XylHRnxLOzYFnzvOHkwH3MBukR3asqY/VlxSPtpC/ kdSHiDhe8kn+wgFT/Q/IGV9YMAHfqPXdKUKGAnJ8Fd0rw9HmcTdpWAo6B1amIQ== X-Google-Smtp-Source: AGHT+IH2GgJAycK8iEP0BL+Y/nNRPeDFOU6sZD34sta5FehOpn9exdLmJ+8wUbycJgimqwAOqbPSDefqYkLEDrfP4+c= X-Received: by 2002:a05:6512:104f:b0:579:c694:fbd1 with SMTP id 2adb3069b0e04-5945f1c879fmr2405487e87.29.1762822715015; Mon, 10 Nov 2025 16:58:35 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: David Rowley Date: Tue, 11 Nov 2025 13:58:22 +1300 X-Gm-Features: AWmQ_bleuWi8E9tWRt79ZqwH07yWQu4rFbj2H5LgqjYbSfQUFe5WqVWLiaS4NCU 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" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, 8 Nov 2025 at 08:23, Sami Imseih wrote: > > I'm confused at why we'd have set up our autovacuum trigger points as > > they are today because we think those are good times to do a > > vacuum/analyze, but then prioritise on something completely different. > > Surely if we think 20% dead tuples is worth a vacuum, we must > > therefore think that 40% dead tuples are even more worthwhile?! > > Sure, but thresholds alone don't indicate anything about the how quick > the table can be vacuumed, # of indexes, per table a/v settings, etc. > The average a/v time is a good proxy to determine this. > > What I am suggesting here is we think beyond thresholds for > prioritization, and to give a chance for more eligible tables to get > autovacuumed rather than workers being saturated on some > of the slowest-to-vacuum tables. Can you define "more eligible" here? I think I'm not really grasping this because I don't understand why faster-to-vacuum tables should be prioritised over slower-to-vacuum tables. Can you explain why you think this is important? I do understand that in your script that the OLTP tables received less attention than unpatched, but it wasn't obvious to me why this was an issue. If it's a case of autovacuum acting on a stale score after it obtained the list of tables and their scores, do things look different if we have the autovacuum worker refresh the list and scores after it's done with a table and autovacuum_naptime has elapsed since the list was last refreshed? David