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 1w96Nn-001BZJ-2j for pgsql-hackers@arkaria.postgresql.org; Sat, 04 Apr 2026 19:10:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w96Nm-000958-00 for pgsql-hackers@arkaria.postgresql.org; Sat, 04 Apr 2026 19:10:10 +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 1w96Nl-00094w-1t for pgsql-hackers@lists.postgresql.org; Sat, 04 Apr 2026 19:10:10 +0000 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w96Nj-00000000bmw-0wMm for pgsql-hackers@postgresql.org; Sat, 04 Apr 2026 19:10:09 +0000 Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-46fc5b8a06bso887768b6e.0 for ; Sat, 04 Apr 2026 12:10:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775329805; x=1775934605; 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=o4LP3Lz1g8H00mV7kE4X2PJmJP4KLDt82bC3TL78X+U=; b=KCzDNDv3kJnrEw+RU5b8LBOeXOrOdk+LmT54l8efuiOHDRQAlNXAmY8pGRWWowVNVE +NMICP0OD33FWJVpKzO7FZ8KnSTyjHgVcWM7wOTY5r376J+wfMQVMMpJkUtKaz/jTUr8 tqIe4lCL//HOQoblhmBL/C8VWzdG2vLXOUSY+pOuQJp/JO6yoK+j5EEJ4LiK9YpVAj7Y NVxLwnrwB0Jeszfycn6LPapY9hVh1QPYs6kVh8F5F0vYHift+VXij7De88M6hfV8QUpu NjlJMc2gK92504UoKCHhGNa0QircJk6pZSpVqKZDtZBiKo1tYviMTVH5gtIFTEa0pR/r 26Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775329805; x=1775934605; 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=o4LP3Lz1g8H00mV7kE4X2PJmJP4KLDt82bC3TL78X+U=; b=H67XjqwYmZPPZ+LofKXXGkka2pokk/ig1aEVtuWxTYEC4N0R+wzsfsGFFLuLMs7inO 64xO17OeAEJfe6Vk+C+i4laXk5e31UcAe7ldOgMOU6Ml8p9GFRD+SVwivoM3wsUOi5kG 7pKQ8FM9Fly700Gl7VfPVSA1XqNUFnL13yobyLNBpvFtJm8MpRm8wcRop9HF7o0RxHSX IZCr+mRGaVTk1heY4F4LCuE0Ou7iDwXIDIdqolO3r3zPPlnF0UY1g9zlVc56SLx5AV0Y iO9qL8d3YJmojRwiMzRnPhntbOqpYV2WxSup5b9SLKjQNWUaXODd3MyD/7FWIYi4wJnL HoYQ== X-Forwarded-Encrypted: i=1; AJvYcCUF0iNSxo/A5J2rg2I+FSvt59yCUYEklukuXE5e3Lm+MBx35ada47YeKDT6wLTFVUtEqm1EtIVGMzgzdmeq@postgresql.org X-Gm-Message-State: AOJu0Yx4Zm8Cg+FdG9MuVDB1afFffNpP6eLpUt3EEUu9x0YWp1AJd4ZN 6fMj4qctV4Tma6ZpcLHn1B+PVnSubK6qiv5tZdSaEvmpQz+ZyNy1oG8l X-Gm-Gg: AeBDiestMzykL+54uEoatvS4COAvmPiV1fTYzoiog4mfr/q/JJpxXs0efw9FfyLbt1Y ZyURkO7YAq79fdfWVVns7JtjEl7zbQ1o4unCAo2JafL55sn3aWtlYEKgJrr45C1eymoVBYA5ICr 4/SsvpPKyjZFHlrzd9kbJmg3Wm8p0GMiPCgAgOy2YK4pYuPxpLFUmNLpjuDwh96qp8Nz1BEw8ue 1t0M9GI9dx1ZkoboBtDXUwzrBWS/v/G0UvAyfClqvP0qtG+8ijdqBdXJXyg95IaUQKYpq55FJYh S0telVn65myZxqb/jk0mLxv03yczVkFp4j+RE18VYj/glR2cFRxSWSN++iCUEDCU9RcANYfp/5+ jppX6lsf9Ca3sTSoJXvwRh3xZFsRjfjk9AuTKb8RyCgRM59ppr82+psN5BwNloyhnTeAXUwJe9G VlEVSH/rre4EZhyMEd8yhEheORWWJSXI/ceMn9LtAIxOiKM8lChe9bnEuOdP/M7goJowfDY1tdN GWiwSFrp2hQZ1BNySy/PQ== X-Received: by 2002:a05:6808:1525:b0:45a:6adf:4d44 with SMTP id 5614622812f47-46de0a24fb4mr5564702b6e.12.1775329804957; Sat, 04 Apr 2026 12:10:04 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-422eb42db1bsm8601602fac.17.2026.04.04.12.10.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Apr 2026 12:10:04 -0700 (PDT) Date: Sat, 4 Apr 2026 14:10:02 -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="wLga2yfBuT3a3SD4" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --wLga2yfBuT3a3SD4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Apr 04, 2026 at 12:48:28PM -0500, Sami Imseih wrote: >> If we did report booleans, I would probably argue for just reporting >> dovacuum and doanalyze and calling out the criteria for why they may be >> false even when it looks like the table needs processing. > > Yes, we only require a needs_analyze and needs_vacuum. The latter > can be set to true due to thresholds or wraparound. But, I don't think we > should rely on the dovacuum or doanalyze, instead we can just have a flag > in AutoVacuumScores->needs and track what is needed. This will separate > the autovacuum processing from the reporting. Sorry for going in circles about this, but I'm not seeing why we wouldn't just return the booleans that relation_needs_vacanalyze() already returns. I think the question people will have is "what will autovacuum process and in what order?", and if we aren't giving them the exact same information that autovacuum is using to make its decisions, then I'm not sure what is the point. It's true that someone might disable autovacuum for a table and that it would otherwise be processed, but so be it. Concretely, like the attached 0003. IMHO this feels much more natural than giving folks booleans that usually represents dovacuum/doanalyze but that don't in certain cases. -- nathan --wLga2yfBuT3a3SD4 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v12-0001-refactor-autovacuum-subroutine-in-preparation-fo.patch