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 1wFkzs-005Vry-23 for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Apr 2026 03:45:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wFkzr-00GjvV-0M for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Apr 2026 03:44:59 +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 1wFkzq-00GjvN-2e for pgsql-hackers@lists.postgresql.org; Thu, 23 Apr 2026 03:44:58 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wFkzo-00000002a4e-32Zv for pgsql-hackers@lists.postgresql.org; Thu, 23 Apr 2026 03:44:58 +0000 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-43cfde3c3f3so6317552f8f.3 for ; Wed, 22 Apr 2026 20:44:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776915894; cv=none; d=google.com; s=arc-20240605; b=Y541qPE4ryM1peB8/LomTx++gr4IUWbxqh9pT6S/mcrrbBrk27B2MFGmyEp+XCpE8P P7QDOgiRiZeIqlbXIbgTvpN4dG1gJlPBkRC2uoFfhU0dpSS2JxuDl3FR1CFRo1WflEpk zaI9vzp7qn4e5PillC2P+dueAQmTtyD+fNNr9ukpYBEioFGHmIhK1hql3T7LJokPH+jD a0RTjvkKY/qa+niyjvhM/Hvimd/NVlCX4tlJYScaEG+zu5+U0TSaN6TLwan1wglCdrpR vV0Omg59mAhhPFtzSz/L4Efhg3HjcsNhm4fgelTFkrrQdAb44knJFpr1Uhz1Cd22Kqjk BNIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=a8dU5FPrcaPng7mYOrJnhNJDfJq+k3P46PDNEaYX2fA=; fh=+cdNiDkuLse1l9QqPeahuJnRAwQVKxC2tapFS48FUNY=; b=TqxChkVtU6e9Kupfz1UY3+/pyoVWhLcpDXEZleKpuFbIUJN2MbuDifx+wzPrnQuYHx iUU0t7eP6bckQ1JgDEUxJGhYrvA8h7atCovQh7YFMeodpCo4gbraKpbCltiEKqxpWygw uGpLUq/b5VPnU3MaVsn/EXM42kxg3NF/+AvPuVrbNSkvcEpgBlvK+l9FACrWYhns3qxF iztOX3YLJls9/xSAcgJA0WVtrKt3W2Sw+uU9JVxBoWQA9no3yE2k5TSyqpeses5i0X3T CrTCPFZTrlbL+94xQWyWYodVIKQVz2mnN6CneTLsKNCm/NShFVfp834P9NY5PdiTX1Vq xgNg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776915894; x=1777520694; darn=lists.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=a8dU5FPrcaPng7mYOrJnhNJDfJq+k3P46PDNEaYX2fA=; b=nIX2ZMi676HjogCRhZNPvE7a2rNmyTtlIo+3gFoJQokHDD/G6+tu9TxWBqd432xowP 7u5MHUWTqzVr2Z4h2bShke/VpNR5RJYUn6Bw4BKbebRTR2rUUp718NbPul8GBrdbkUxh gqZQpnJMGCFLrqaH/+V5k+b58ipoi7aQU9MD2PMPE6nhYyWpeXMJLxbgyat87y/hcL/s DZnbp/3/YX5zdXGcVTp8QLk6w9+ZEk4SJmRm3v2rqns71PIcMq4re0Pv4wHA3uMU8Tqt z5qbSHQ2TKswo/YpYpTohbTlIqLPwuNPcL0CjcWaFAUPFTlwZD6zDwiie3UIXYKWRGgq Utvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776915894; x=1777520694; 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=a8dU5FPrcaPng7mYOrJnhNJDfJq+k3P46PDNEaYX2fA=; b=KkY8WoraJiqiSSZ7ciB4AQm3s0S+jTN4kpH9kAnrXX5l/gyL9jJt5ZhpqF8CBskkoE vMdmyv4/tp2x0EAzojSPAcfwC78MnUbt2QEyE84Fk7YDGcfoLtnR9GGtdERaMSYV1SwD eAedHVNnv7aLD6wjxz+JSG+MYXdoSTDrR3eXI7y+eKFQ30UU7YpozUQXHC7pSCcnsKbL OssawpzpEjfV7R98IKrCtA0LvKhz8TFlzxHvizWmTSnoSYrdB3vnpaOelIrPpn5k3XXz hE0f+Bw5/bggLTrsdTpCUXatiBhLELaQgLZxJnAa3P/FpKhrOL6Rp2vJ0ELXFhOVmhYN VuiA== X-Gm-Message-State: AOJu0YyAkrfgTnpXfFR6OhMS8iloJWjp0b20PjPS9PU2iwGLIAHAsqXo 8hjQRVldIIaq8xnfkBXGSUdwLqh4eQ5Tm8fnxEtZqHDleQJj6XfLXXy6QZwk2VCvRzktchPN3yf DFX860z5GicKnDNiu3CsFU2oWy0vHPuaPLTvJ X-Gm-Gg: AeBDieuDCRvaq83wRZeNlRD0TZ+7xRET4dDrgkBm6Kf8IXr250k7m9qxdTqhzgDWK+I yoNWjM4SBo8YrVqcxPX+EaIuF8ctH4ma+G4O8KqpvKOcCaAV6rSqHQWWVaBKpZ3+PS7G27anLtN hfE6GPiQm9Fq1fV8j2/Wr0Itk/HnIYyecn2ncI5luoB6dOpRWtmM3inwIVl47cJqfPB37J2ZLQJ LnXNwGBySqwB7tObm/+v4hIWN0psHjo4ATvQNYwvtqpj1AgZa2z8jRx1zMjl8zUe5v9r4pBQc90 hKelQgLRjmZkyxYDdFRNaLtAoKuXjjEBYVqVeMkEaujxZFutdgNI+i/iEAcqzp683289MtA0xlo X7LAAjbfJx5nkztNPRg== X-Received: by 2002:a05:6000:401f:b0:441:1e8e:d8f7 with SMTP id ffacd0b85a97d-4411e8ed9bamr16551006f8f.29.1776915893955; Wed, 22 Apr 2026 20:44:53 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: David Rowley Date: Thu, 23 Apr 2026 15:44:42 +1200 X-Gm-Features: AQROBzAWMXnVo_hOHTiuzvLncYATP4UTvCqJ1Eog3D44Lk-WL30J_I4II-PNOnk Message-ID: Subject: Re: New vacuum config to avoid anti wraparound vacuums To: Mok Cc: "pgsql-hackers@lists.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, 23 Apr 2026 at 08:19, Mok wrote: > For example, set to 0.8 a 'standard' vacuum would be triggered when the table reached 160million with a default 200million setting. If that's what you want, why wouldn't you set the autovacuum_freeze_max_age to 160million? There are some subtle differences between a "to-prevent-wraparound" autovacuum and a normal one. Is it one of those differences that makes you want the extra config option? > Then run some activity table b keeping a inactive to increase its age, but not trigger a vacuum using scale factor or threshold settings. > When the table reaches ~10000 age it will trigger a pre-emptive vacuum to prevent wraparound vacuum occurring. > The log entry for the event would appear like: > > [56957] LOG: automatic vacuum (age-based proactive) of table "postgres.public.atable": index scans: 0 It would be good to get a bit more detail on what you think this solves that cannot be solved by the existing GUCs and reloptions. With any luck, PG19 should make things a bit easier to get on top of vacuuming work during off-peak hours. If you, for some reason, wanted to vacuum tables to get some freezing work done, just use psql to run something along the lines of: select 'vacuum ' || relname from pg_stat_autovacuum_scores where schemaname <> 'pg_toast' and xid_score > 0.8 or mxid_score > 0.8; \gexec Depending on the desired outcomes, you may or may not want to zero vacuum_freeze_min_age, or use vacuum freeze. David