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 1w6Poi-004HQP-2v for pgsql-hackers@arkaria.postgresql.org; Sat, 28 Mar 2026 09:18:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w6Poh-00DrNa-1A for pgsql-hackers@arkaria.postgresql.org; Sat, 28 Mar 2026 09:18:51 +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 1w6Poh-00DrNS-0F for pgsql-hackers@lists.postgresql.org; Sat, 28 Mar 2026 09:18:51 +0000 Received: from mail-oo1-xc31.google.com ([2607:f8b0:4864:20::c31]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w6Poe-00000001dDt-1auZ for pgsql-hackers@postgresql.org; Sat, 28 Mar 2026 09:18:50 +0000 Received: by mail-oo1-xc31.google.com with SMTP id 006d021491bc7-662efd1bdd4so1652233eaf.0 for ; Sat, 28 Mar 2026 02:18:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774689526; cv=none; d=google.com; s=arc-20240605; b=jCqeva1nW5mwwVoGi+iCgOw58sHugMCVmXFv+18Pmtwi0H+SOmJCLbsaVmyk6OahKh JUDYnB4sGhp6eBnTZIHEnY0jbN1w7qb4eEPUBNVf+lriQMror23TW3srBYnlhcER/Vtq 0+j9kq63kcXivwjK/JE4OQHzvTdHz1WwuUeJJxzK6COOCJng4cYOyH2mSUbowKt42mM/ b1VQCrIjKBCYaFz41cpvist/X0EBm1wfkzQzwhFJasjMCWuJzC6MGQGBZbekMYq0I1t/ QtYsmhp5iLbCXcuSwNyHBPB16TyFC4+hxXQjBG1ygU+t0+aBv13c+C0ciNl4jacM7oMf uV3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=0Wt/86nipF6lxrgy9ggNgbMZAvE50/vJRuba7d0m5DY=; fh=eVUSIqo8oW6GlS9+lJ2dMbh393DkmW/G0CKaTSrcg9Y=; b=DzckniY3UPdWB4sikuHv6yq+jIfqMLBPlO/Phms52DFtxdfNWjQuHm6irKcE2W1QsJ +mWXD1hw0s2PVwQVEyYvpJ2K/hUX3GCWWnpvvfdLZxhjnj2XSB+XlaHMs4gwBHiZFYqb bOaYh1cYvMwPjnVJjvIG+XzI6SdATUljN5zFbd4tT5MHTxfzyozEqUG4sld68CVSlxXo zzjxoEus+vYfpKHUQSiNxk8gpQ5obzlEhBnT1zohgC6Sr7sbYqRfQC/BZJqRgUWSj8QJ ac1JqgYdfNbj33CdvIiVkM6pWehzDYhvqy75q2WyF1IGkmFqxK4rTWpotKw6PKRqf0ME ukpQ==; darn=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=1774689526; x=1775294326; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=0Wt/86nipF6lxrgy9ggNgbMZAvE50/vJRuba7d0m5DY=; b=TeAzcm6mUtonwixXarzz51erQ0WaROeg7urOQlOG/3UEhRXjzdnyT9XJcOKLCX7ZeV jtialj9s3QLpI2lIa6Z2yrfskggeMHU/Qyk9tJHv/auXDbBquvaN3zW+ptkLxpSZf+dC dXzlX8r1BnubLzHku5f51xU9DAKCdphGjSn3/gner+Mh2HpIVVZceNtrt/AI54VbeLWG LSNP8Iar6GyIPTb4s+w67m+v7wi2weyFC5aTmus8Z0Iqnm3GfCtQ4KnKnbUmQ8gPlPSH ZyIpAcKg9anf2NT787B0JNUmyKIxxWH7a3tkyAAbBUwvFOBbczuj3IscayCFVMbkvepp funQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774689526; x=1775294326; h=content-transfer-encoding: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=0Wt/86nipF6lxrgy9ggNgbMZAvE50/vJRuba7d0m5DY=; b=fNLszbjesHd+qXtp9lvuJogXeF66LaN9QEQLtzw3SDdxn8zmCWdmQl3BWJnN05wj8s scj/ePGF6PlMUzxKlpdjwBPwi0W7pd9eGAKhMaq/wnIx/RmW4MUVHbQ4WUVjW/tfWZQ3 +71bqsygg789fnsFjCZBgvFoAZKazHe9R/qnfDos7rmL1ICxFc8D/1JGU/BWgaduNamv B6+fmCwLabF3Ro2XvferMCMqnKLpsgde2779/hdE0CIS+xG90Fvehrfw2oeKHhpMQknD 7OXW8LPv205/K4zc5rrV13APrpLkcM3nD/NHLKaInh/KF6BadeylT97A5l0tGHqIvjns SqyA== X-Gm-Message-State: AOJu0Yym62pWze0MDVGjwSI7c83+pUQfOnyxPyXe2pQLbhUG1VmzsNnI 7Hz2cAcnFSjpCitQbxIzDm+ecEQg24I8OtHzjsRJ80s9iXXT9F03jb8HqV5VGPg1p0bh2mkt+Id R3HTOzj9SFTplUsgp6Msa6Jqe5K/HueA= X-Gm-Gg: ATEYQzzBzK4BjW4st1c4rPw4k6b6eiC/wf8M05Ha2UBPganZwldO7gPCnWkB5xs0NdP w9o8xSB4PDClD5XagQ5xi/pUgcxeAnrScYMLXT8jnfSRUTXzY8eQJGiFuVsTWNdVgBVANMdzxTx eysJKEW+XGnbOmsnXx3r08bML6HOC5D1iQddNA3kksXNBI0lerBjuMC+AHXHcTqw0iiMyAk6IoG 069Qf5ZehbPtsSruAYWC6sBTxgQmVQVFPGEKMejy8yF4ac6pvhTe99WowxLK45vBeaEUxe8IVaR HB9BJpKNJN+IBFVBbiwpwrKiKyFWqGEWCpSfsvU= X-Received: by 2002:a4a:bb88:0:b0:67c:2bfd:24a3 with SMTP id 006d021491bc7-67e10ce7d8dmr3124515eaf.20.1774689525997; Sat, 28 Mar 2026 02:18:45 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bharath Rupireddy Date: Sat, 28 Mar 2026 02:18:34 -0700 X-Gm-Features: AQROBzDlRVaLJgMRun33EAZ5xMtemIIP8tkr5TaZRsY8rXuwsnjWsfeqt9s9FmE Message-ID: Subject: Re: Add pg_stat_autovacuum_priority To: Sami Imseih Cc: pgsql-hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Fri, Mar 27, 2026 at 4:14=E2=80=AFPM Sami Imseih w= rote: > > This is a quick follow-up to the commit d7965d65f which > introduced autovacuum prioritization based on a score that > is the Max of several components, such as vacuum > thresholds, xid age, etc. Thanks for sending the patch. +1 for the visibility into the new autovacuum scoring system and its impact on prioritization. It would also be nice to add the computed scores to pg_stat_progress_vacuum to show the current prioritization. IMHO, we can get that change first. It's relatively smaller. I quickly reviewed the v1 patches. Here are some comments: 1/ + * pg_stat_get_autovacuum_priority + * Returns the autovacuum priority score for each relation in the + * current database. + * Can we have the per-relation prioritization computation function in C and provide a per-database computation function as a SQL function over this per-relation function in system_functions.sql? This would simplify things and also address the concern raised by Satya in this thread about databases having a large number of relations. Would that work? 2/ Do we need to revoke permissions on pg_stat_get_autovacuum_priority for all and grant them to pg_monitor or similar? Especially since this function loops over all the relations in a database, we may not want everyone to be able to do this. -- Bharath Rupireddy Amazon Web Services: https://aws.amazon.com