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 1vIuxK-002iBg-0l for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Nov 2025 20:27:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vIuxH-007cQf-2H for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Nov 2025 20:27:07 +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 1vIuxH-007cQW-1L for pgsql-hackers@lists.postgresql.org; Tue, 11 Nov 2025 20:27:07 +0000 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vIuxB-007DJu-2i for pgsql-hackers@postgresql.org; Tue, 11 Nov 2025 20:27:07 +0000 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-5957753e0efso80676e87.1 for ; Tue, 11 Nov 2025 12:27:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1762892821; x=1763497621; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=CTkxWF2o3SryA1PNkpItFer+ca1niKoMM+lOElCT7Ac=; b=NKBKZ1Qtz13xrG1v9eC/HmKFwaG5o818Kb4tL7VVwxuBku7zh8Vk+5Ls3rPK3VcbyS jLFKUDk8KuoehruJ1QakPiIJCb51zB13qe8KWD6x4qJK251gRvkRI1bdAFwAiG0u3HSs xr68KfnSYRxq60noZhWxIsCKQAVinT/a+/E68Dr7pYLviMKtYOXzwIqql2azsTjPx5Qy f8MAwfIABmAycW6hBGbS5/YOANEWp6jNWPNJtdU0sweqQPUW57uZ1vb2whHyz/LdWD3u s4tNNmmanUJPHPe7YYepwrJomn5lBYlp1c+tatfYtTvDqOpqixt98oWqUQu03l4zKpYf WJkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762892821; x=1763497621; h=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=CTkxWF2o3SryA1PNkpItFer+ca1niKoMM+lOElCT7Ac=; b=so9VZ+ELU/v4TMj5wVwNlSYfUpgRhrUXzuzq5/BJZi5W3CIw77vLA4HF6QxHRB+6vG wm4BMTcRPiseXjbLVpZJgwjuUO696X1jpV7cChWshuZ8FDtqQmdAN+FBLXMQCsqcpv2G cvv6iMh7yQOxqyZQ1u5RqyhHvly0cZzHQLgDMPx9z66OrJvyVBdSa79dmBM4Cd2sPZgH Bp5ju5g2KK/DFO/qnynEEKQCHcjZoyv4nmXPqiMq207qgSz19LlDQFlAR9JKMuFRcj6F yfJL6kuytz1ur45hwxJT8i++9pn7yu18lw7yQ6GVDm+T6uS/IQT1zckPUDmgKtdkPdfM z/Qw== X-Forwarded-Encrypted: i=1; AJvYcCVSf4iO2oL/WLc+Bim2e2QuUFJfjiMD9M36Nf2y8FfwS0XTVQViiXWZSAKI6WDeVA5c2ytgZcs+Lh8JEx7k@postgresql.org X-Gm-Message-State: AOJu0YxyWgBy4DPvpWT/4GYBNCYbKIj802g8skSCK8cKYwMmPmS3kxL0 xtuFo1SvDhDEuJyYrGv27hb39oR8tbjV+eTtlFah3Z9UJRb6M7bZfkRuexTBpqB2gF+2Ptyv5FO 7mz1sRheXBMHiwossPLtIEQh4Qq3NrOg= X-Gm-Gg: ASbGncvAIxLDrKdt2D9pU0boKG7A6JCaUHPZLk9Tdj4ZR6q5T23557+Vq0gxcOf/5KJ 8h1Bj6GyosMBeaAtK1nr7DxwyZTRW2Apkp+L6h8h5aLIIwfafeDdyZ/lWRd2XfbZZfJX2UF2EGU wOz8lbvOa+sUwWJ7s9XYglV+apftkHbMYxyvhbuOfKgyJ2J3a2zRT6WhfvCjm9oT0qvgXTFuEvn 3v6MoqxclVi2V3jUsas/gbgHUZbFFUovQtLJHnE7wNgECDpiWS3UikAaHjl6MIW2Dt6mMrgjaDz i8GrRzLhA41N25fby+Seib7xv/rd3uCk/LAbEM78328/Ji1mTddSKnLKUcotww== X-Google-Smtp-Source: AGHT+IHRszNeeV3/VeaAJ7T600s6/DUUpbG2pT4/c5QV3ZgvcDzTfMi68MXeUYhozsXmDqsrkBtk+k7dRV7VDJkTkhc= X-Received: by 2002:a05:6512:3a8c:b0:594:4b7f:f946 with SMTP id 2adb3069b0e04-59576e1bd65mr148579e87.33.1762892820707; Tue, 11 Nov 2025 12:27:00 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: David Rowley Date: Wed, 12 Nov 2025 09:26:48 +1300 X-Gm-Features: AWmQ_bm955CZqsirwqawle6HOCZhK5pJrlkhrh857tDb-p2vbK1adfGEOeJmzto Message-ID: Subject: Re: another autovacuum scheduling thread To: Nathan Bossart Cc: Sami Imseih , Robert Haas , Jeremy Schneider , pgsql-hackers@postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 12 Nov 2025 at 09:13, Nathan Bossart wrote: > > On Wed, Nov 12, 2025 at 09:03:54AM +1300, David Rowley wrote: > > /* when enough time has passed, refresh the list to ensure the > > scores aren't too out-of-date */ > > if (time is > lastcheck + autovacuum_naptime * ) > > { > > list_free_deep(tables_to_process); > > goto the_top; > > } > > } // end of foreach(cell, tables_to_process) > > My concern is that this might add already-processed tables back to the > list, so a worker might never be able to clear it. Maybe that's not a real > problem in practice for some reason, but it does feel like a step too far > for stage 1, as you said above. Oh, that's a good point. That's a very valid concern. I guess that could be fixed with a hashtable of vacuumed tables and skipping tables that exist in there, but the problem with that is that the table might genuinely need to be vacuumed again. It's a bit tricky to know when a 2nd vacuum is a legit requirement and when it's not. Figuring that out might me more logic that this code wants to know about. David