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.94.2) (envelope-from ) id 1vDqtY-00HWmQ-Ue for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Oct 2025 21:06:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1vDqtX-00F8nR-Iq for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Oct 2025 21:06:18 +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.94.2) (envelope-from ) id 1vDqtX-00F8nI-9A for pgsql-hackers@lists.postgresql.org; Tue, 28 Oct 2025 21:06:18 +0000 Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vDqtU-004lQX-0o for pgsql-hackers@postgresql.org; Tue, 28 Oct 2025 21:06:17 +0000 Received: by mail-io1-xd2e.google.com with SMTP id ca18e2360f4ac-9435969137aso401311839f.1 for ; Tue, 28 Oct 2025 14:06:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761685574; x=1762290374; 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=EnlVpuHQZhCAarXExPRjVultP0VeRAQuTbG+PcUIqZ4=; b=brVkN2DWeiI2O/5hCEZPqciKnSjxjl8b+xHKf9ucBAugW08PqMTcdd/pC3EFySlzIj XAD9ssyoxb3EBIzXJkmK+LRMx5fvGlPY6GnxDoypoSs6YAq+bNO5iRtA4+3feZEvloJ/ P2KY257T5R/pgn6I26sYC2g6N/i9uZrGwalNmTYJ2MK+5RZoh7nQv0ZuP7wBdqxXjb8A apICrmamLAhOTiaCrs66IQMdYIBPosinKXknvrnkNTVIEVDtvDi9NJd2RpyLQQoUqsaC W8piWeRbAjLzJMcv7wLnxaPyb+CmRGXYz9Fp9unTDwQnUVYiCnjgMQbyyw42zdy5093w nENg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761685574; x=1762290374; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=EnlVpuHQZhCAarXExPRjVultP0VeRAQuTbG+PcUIqZ4=; b=HFuwppu7bG8E+7wEm0OCmoCAFhH0573wOwggPEJSyyZyve8hFpC5+upY/7NvHhp5qk ldSAQ0vu6wykUhH55ztZX14G/pQY6gyTb+Nfg7j/kkQVbtrI6JbiTDWDo+UCWVoi7/+T CudTRpE7i3AYUkG185RDTT4dXHWYyp/A+1G8umBrU46ZMgFU3VpwtFYY6sAV5yifJ28A PVgy0LJPlZIjJzrEUAwMozSUus0C5BbJnYj6o1Z7z/Z137nzk2SKJ3Y0e6A0fJi9sXUJ jETi9cwsOz8zEL8Q6NP4tC2qtLGF2OoOqoIlofUCYkkf4b7rt6HAkzuziJOJsYDtUV85 UIWA== X-Forwarded-Encrypted: i=1; AJvYcCWlngL649iFRhFpHMMqEso24kjsKDsxbzbdhZYVeulI6VJObVlg3uWqw3MPlSXR/PtwnBEcGPGun0tehLqS@postgresql.org X-Gm-Message-State: AOJu0YwSwEdrP74oAc0Mtvijui0/tkAh6+ba4Efz3USG+Wo7zyN9Rfzt BbGM+DlVqM3Bytk3sxccHEGNXvriVrwGBdNzgBE2vd57coZpe1EGedik X-Gm-Gg: ASbGncvoaSxrRHD6rYx/Xf9OMSr4DFWG7e3wD8ezka8N6INClhQ2UdXlnGnVLolJ1Ke 7ykk/grIQyASrQD7D8b3O43l8sOGdKIG25YMUzo1EX5g9iHGasyjEH6mG6C6RHrhCJB192mq9kh O8eAwgFauhRRzaeqLNFJdNqSbAESUCGsBp5FyoXirIMYR39Cfdfs9nvCc+OPJeXa1sW9JiNlyP3 aJ2MrR1KvTyABUvC7dnYTFaVfE03ZaCtwRmYaPrCJizjlDknBB0Yxs8qO8kZY9oePwKgQac6fbg BVR+2GoL4/6HSf1mKQCFbZQSUVyrJdhz4hAPO0nCgM6WHLkDQVD1TfslFV5lWVOVftEMZX3TRzG V6kFBAF35oXVCcV/vGNuEhKAbfnRyuHWapYi8+CrVylfU2UvSXXw728jlevIhaPrWH7SdIJq+US Jr9nGXmiHtpDAWXEzl/i3x0KVwbG6mDI+GUPQnmAAPDlQtsIDDCEEyX+G40WwGPB0TPA== X-Google-Smtp-Source: AGHT+IFa08fwZTIG+P0w7QmY49jzbPhwsUCeHrQXsCW/8gno5nup0wuzSuSpWsybuFuBSnfIXMyxig== X-Received: by 2002:a05:6602:6408:b0:93e:84d8:429 with SMTP id ca18e2360f4ac-945c97622f5mr122712539f.6.1761685574294; Tue, 28 Oct 2025 14:06:14 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-5aea946dbe8sm4868550173.29.2025.10.28.14.06.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Oct 2025 14:06:13 -0700 (PDT) Date: Tue, 28 Oct 2025 16:06:12 -0500 From: Nathan Bossart To: David Rowley Cc: Sami Imseih , Robert Haas , Jeremy Schneider , pgsql-hackers@postgresql.org Subject: Re: another autovacuum scheduling thread Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Oct 28, 2025 at 12:16:28PM +1300, David Rowley wrote: > I think it's reasonable to want to document how autovacuum prioritises > tables, but maybe not in too much detail. Longer term, I think it > would be good to have a pg_catalog view for this which showed the > relid or schema/relname, and the output values of > relation_needs_vacanalyze(). If we had that and we documented that > autovacuum workers work from that list, but they just may have an > older snapshot of it, then that might help make the score easier to > document. It would also allow people to question the scores as I > expect at least some people might not agree with the priorities. That > would allow us to consider tuning the score calculation if someone > points out a deficiency with the current calculation. > > Also, longer-term, it also doesn't seem that unreasonable that the > autovacuum worker might want to refresh the tables_to_process once it > finishes a table and if autovacuum_naptime * $value units of time have > passed since it was last checked. That would allow the worker to deal > with and react accordingly when scores have changed significantly > since it last checked. I mean, it might be days between when > autovacuum calculates the scores and finally vacuums the table when > the list is long, of it it was tied up with large tables. Other > workers may have gotten to some of the tables too, so the score may > have dropped, but again made its way above the threshold, but to a > lesser extent. Agreed on both points. -- nathan