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 1vN6ox-00BIsk-0l for pgsql-hackers@arkaria.postgresql.org; Sun, 23 Nov 2025 09:55:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vN6ov-00E44s-2M for pgsql-hackers@arkaria.postgresql.org; Sun, 23 Nov 2025 09:55:50 +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 1vN6ov-00E44k-1P for pgsql-hackers@lists.postgresql.org; Sun, 23 Nov 2025 09:55:49 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vN6ot-0012c0-3D for pgsql-hackers@postgresql.org; Sun, 23 Nov 2025 09:55:49 +0000 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-5957c929a5eso4675024e87.1 for ; Sun, 23 Nov 2025 01:55:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763891746; x=1764496546; 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=UQuXSaZogaDqmtURA0fxhlrLakeP5jHX8ce73nooRUU=; b=QqDaB/N02hH0oGbMxkAkq8UaJSsIVUcmIgtszdkkjpbplbRSxb5v9bj9qM4o4FMg2J 3LQzddiWTz43RfzSGOFg8dO/f5OmZMjbrGj063CESOKBonZWGBa+JaigUl+mX+kUtoXJ bts8qVWqqwoetam6DS13cKyGwt0McSc8nKcIXhRDqtn3iCK2gzmPCuvxncNtrr7XAXWs vzbejS/mi0JUel4HuW4vcBo2ddDAC3CYI4URxpYNDCYmV7M66ziYYb9nKITEY1UhcHui LclhIkaR3W9xeKf7uSpZwtYNn5/++qY3niTbHTCvy8Ba5AkzS9rc6usFxUDPsNVq1jmX 5r7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763891746; x=1764496546; 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=UQuXSaZogaDqmtURA0fxhlrLakeP5jHX8ce73nooRUU=; b=k6YhLEvOfBedxbJfzeikb2rWrzg6cSlnZzXBYfLrubmLUkwXb5yvU9wa6Fw9cJto4Y 3up0sqWCRJab0yF783gME7oPMvykIfWGSMXSh2nxIGN9h5WxYf+Jm3l7WiiaAWIWTZR+ /GutdjEUjdzsNLjhCn6Egn9tnsFJKD2gIAWpuxi/qFSgI/Pd32bEDr+fY65Bjfy8/ZqN zo7GfAbvyWJg3FUrWEqi/qu87sJFd9BTvYvWHMz04l530VOEGIWQa7LoTc8D2qB2ZScI RgGi7z3sufZ+/c1Ox3svBNZ9K3yKx06eqmnwm4yDZf0jx69eS5zRrguvnC3ZR3I4Xdko nEZQ== X-Forwarded-Encrypted: i=1; AJvYcCW2xfnjrfiJG1GS5OzXwCGp+eB8d8WHO1C4TTZSDYKOiTHm0IZ43Zq6ZNuC3vzCLd2kZPhp8CXLCmaFHT8P@postgresql.org X-Gm-Message-State: AOJu0Yx4oamYs8vu8+19fKTUqrRFnsW/XTFLW3QhUcg+AW3qg+HTjUZk LN/eDUJ6tQjMWV0z1AumoAye+lUqAxXD5kicNrm4LGFXvwmE+58a+2fD3QeHRDhhgRHLh1t8R/R +H6LYsiC8aJ2x3SQlmYX33geAsR/+AzI= X-Gm-Gg: ASbGncs/4AEBEwTAw73YIL+kkPVj6FvBeEL/KkohZBJCUjVjIg55Ewlp5jBWdmHyK55 Hp5b56WuR/De1qTz3vMjeTXCkqEn0HMh8vHNh+0pa5Ycz8Bi3tE1IlDkqG/UnJOGgiwJO9DOT2I DndGe7E1wN+yWxDRnOM7tfapRQjCfkollsReoSUMp79Zwh/0LdKpcugBWzwvQjIt2O1O42o/A/E KEAjzKE++k7xuqxTsaIVda/rYkB210Pq62IUTPT7BbQ3idb4EVZJTfq/3BXUkTYePQfrQwZkuUQ TnyxcHuJ3ulpXDEP/ztiHBMOoa+ZHPZqt+GWXMfdubQJNbnm+vX1h0q3t2r3VQ== X-Google-Smtp-Source: AGHT+IHq3+RewacD7aCeT+CpCGwzRCDn8+xkhogM2gSzle1Uu54OYU/gvdhzRmBupyT5AGz638rL2o/SBv+8r1Y/J6s= X-Received: by 2002:a05:6512:3341:b0:590:6598:4edf with SMTP id 2adb3069b0e04-596a3eff7fcmr2179517e87.47.1763891746171; Sun, 23 Nov 2025 01:55:46 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: David Rowley Date: Sun, 23 Nov 2025 22:55:34 +1300 X-Gm-Features: AWmQ_bkRA6tCNUxCdlk4S1Xnzk4UPdQTQS7phbyHX_ry-GzCWdQ4pp_gP2uASoY Message-ID: Subject: Re: another autovacuum scheduling thread To: Robert Haas Cc: Sami Imseih , Nathan Bossart , Robert Treat , Jeremy Schneider , pgsql-hackers@postgresql.org 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 On Sun, 23 Nov 2025 at 07:35, Robert Haas wrote: > > On Sat, Nov 22, 2025 at 12:28=E2=80=AFPM Sami Imseih wrote: > > What I have not been able to prove from my tests is that the processing > > order of tables by autovacuum will actually make things any better or a= ny > > worse. My tests have been short 30 minute tests that count how many > > vacuum cycles tables with various DML activity and sizes received. > > I have not found much difference. I am also not sure how valuable > > these short-duration tests are either. > > Yeah, I'm not sure that would be the right way to look for a benefit > from something like this. I think that a better test scenario might > involve figuring out how fast we can recover from a bad situation. As > we've discussed before, if VACUUM is chronically unable to keep up > with the workload, then the system is going to get into a very bad > state and there's not really any help for it. But if we start to get > into a bad situation due to some outside interference and then someone > removes the interference, we might hope that this patch would help us > get back on our feet more quickly. One thing that seems to be getting forgotten again is the "/* Stop applying cost limits from this point on */" added in 1e55e7d17 is only going to be applied when the table *currently* being vaccumed is over the failsafe limit. Without Nathan's patch, the worker might end up idling along carefully obeying the cost limits on dozens of other tables before it gets around to vacuuming the table that's over the failsafe limit, then suddenly drop the cost delay code and rush to get the table frozen, before Postgres stops accepting transactions. With the patch, Nathan has added some aggressive score scaling, which should mean any table over the failsafe limit has the highest score and gets attended to first. David