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 1w8hgT-000nU9-0w for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Apr 2026 16:47:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w8hgR-00CgWN-2y for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Apr 2026 16:47:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w8hgR-00CgWC-1E for pgsql-hackers@lists.postgresql.org; Fri, 03 Apr 2026 16:47:48 +0000 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w8hgN-00000000NpG-3mSS for pgsql-hackers@postgresql.org; Fri, 03 Apr 2026 16:47:46 +0000 Received: by mail-oi1-x229.google.com with SMTP id 5614622812f47-46f0fa0e398so551293b6e.1 for ; Fri, 03 Apr 2026 09:47:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775234863; x=1775839663; 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=y1Fk0b9R8RSWbUhxLFSuuQRONmuROV+Uwn08bNjwXQc=; b=Soc5obZeUS+awXGEROW0e0tpbUju8lSScGme98Zd1enn97cQqoqtnR0Qqpr9YLLSTj kHWsI+nv58qx3n0hECRTapZxX6vL84cJK4cl6F/Gt6eEeF56wmrlGCNLHxaY6CaWa0+W Pyhpth/SAtRW7RUbXKcuNR89zwLNEgfkP6Ei/fQxxiXsmcZvV6R/YjP/BnVre30Pe+QH wKrW9k6stuQh80AcfgDnzyITQKBheesVten1LfzsWuUuXcMaOKzVeAOYvjVvLosykQtC bSU400B/uTkbMDKOacoEpVZXnxxKBchjb1D9wJAokX74TnFXA3cSHEbfgdihPOCVjanA FI7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775234863; x=1775839663; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=y1Fk0b9R8RSWbUhxLFSuuQRONmuROV+Uwn08bNjwXQc=; b=aEDG7VOPhPaahw3H6XWU9iyufY7Jox5YU6iOBwHTbqxbB+xsD5TlRWUkVhsM72GcbW hVyY41e0wflRD2trn3CvbedsS7OyJ9Pju/01nJDAjNWFiseK80+oSIOok6xSkblUYMJ7 NdezacUYghNCmNwRQhe8M5vK1yzt/G2caYYQ/yzTLbD1159Aix5AJuVcan+CtHloU/Lj PeuFRq1cimFm3Th7o8eMxbfgTCNpDNB+yX6V7QH2r8dlVSWg5eRi7LGOmfvdFiKPn0cx SVcZ6/d6IQ7VCjHhZ94Lqdb21JUp1GEk4Mvx9TcqWAS1itgNnH2AeAoUdf5hML2NVVvD Qdsw== X-Forwarded-Encrypted: i=1; AJvYcCUZVYe7gBNK0MXA8kgTvvRZ2jHdSP4sgpiVSUD8JonWpNIsKSyG3sgkF1YYa6nJedMknuMTJXgBNJTPKiWu@postgresql.org X-Gm-Message-State: AOJu0Yz0LK6JTGaaJo83abZQNQcKQWJwrKzjcEVUTeWxLmcX32RtFybn nIISv/JcMON0qdw8uffQ0QraBpT+JPtzSpuXzC7bweNzgz1mIYnIfHEa X-Gm-Gg: ATEYQzy6QbmbEpOGTb7kGDSvp6uMFLcZfLyWhf1xN17FFmjV73pdkSw7nG5xc8L3zZ9 XfyYXY7OBoUV7FGP3ykZEQ1Bwoaemn2LdI/AtuAkiu0jAoXJKzwCrs1t+ow56Q6w4G4s263oMWw Zkqqhz9NkZRDXckNCdYMDn/BYUrdDrSb0UxgKtbi30U5NIUHw1+WR8IoW6KzwLGi5WDoEi4ioJY fINTuwqjuPtyq0YoHnTj7JA35TBmC5LchzywGNoYgY5eVmR7SNGfcrN7BOzSz5g3pQHzX8PWlfP owSowRdDD2YrJGhNUTfBAMqAqPJIq1NyvL1X+6mHeKrbk9En7focvhpTnWwtn9mubKEnYIoVhO3 VzgekR8mH24W7sulFJtwcR/zl79xph6gTXTfp2Tz+lqV6S/CQzm5lxpyDhWMbEZvcex9zB9mHbc ZEHDCYlytiXmpeEHuQEWu5Z2qLn1/2a1+cQWANPWEPqRgBiaO++dCr7F+K1DroxdiwwSVCEy444 /rSUJaqaa8Q9Ts2F/5EIGF0vSqoEvYT X-Received: by 2002:a05:6808:c16f:b0:467:f9ff:7c54 with SMTP id 5614622812f47-46ef821cd1emr1816553b6e.45.1775234863285; Fri, 03 Apr 2026 09:47:43 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 5614622812f47-46d8f9609bfsm3502779b6e.3.2026.04.03.09.47.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2026 09:47:42 -0700 (PDT) Date: Fri, 3 Apr 2026 11:47:40 -0500 From: Nathan Bossart To: Sami Imseih Cc: Bharath Rupireddy , Robert Treat , satyanarlapuram@gmail.com, pgsql-hackers Subject: Re: Add pg_stat_autovacuum_priority Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="/vKBiHkEvphli8Mi" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --/vKBiHkEvphli8Mi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Apr 01, 2026 at 06:04:36PM -0500, Sami Imseih wrote: > Thanks! here is v7 Alright, I've been preparing these for commit. Most changes are cosmetic, but there are a couple of bigger ones I should note: * I added a prerequisite patch for relation_needs_vacanalyze() that saves a level of indentation on a chunk of code. This simplifies 0001 (now 0002) a bit. * I noticed that if autovacuum decides to force a vacuum for anti-wraparound purposes, it might also decide to analyze the table even if autovacuum is disabled for it. AFAICT this is accidental, but since it's behaved this way since commit 48188e1621 (2006) [0], I am slightly worried that this bug may have become a feature. In 0002, I separated this edge case in the code and added a comment, and I intend to start a new thread about removing it. * I removed the booleans in the view in favor of just noting that scores >= 1.0 means the table needs processing. IMHO trying to distinguish needs_vacuum from do_vacuum is just going to confuse folks more than anything, and IIUC this information is redundant with "score >= 1.0", anyway. * I renamed the view to pg_autovacuum_scores. While some of the information in the view depends on cumulative statistics, not all of it does, and what does is quite heavily modified from the original stats. So, I didn't think the pg_stat_* prefix was appropriate, although I can see how reasonable people might disagree. * I considered whether to make the backing function per-table and ultimately decided against it. The initialization logic is a bit expensive, and I assume most folks will be interested in the full picture of the current database. Maybe we could add a per-table function down the road, but I don't see any strong need for that for now. I'm planning to commit 0001-0004 this afternoon, assuming cfbot is happy. I'm hoping to commit 0005 on Monday or Tuesday. Please take a look at v8 if you have time. [0] https://postgr.es/m/23710.1162661716%40sss.pgh.pa.us -- nathan --/vKBiHkEvphli8Mi Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v8-0001-refactor-relation_needs_vacanalyze.patch