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 1s4SBU-0045ik-NG for pgsql-hackers@arkaria.postgresql.org; Tue, 07 May 2024 21:17:12 +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 1s4SBS-005Ip6-5A for pgsql-hackers@arkaria.postgresql.org; Tue, 07 May 2024 21:17:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s4SBR-005Ioq-Pq for pgsql-hackers@lists.postgresql.org; Tue, 07 May 2024 21:17:10 +0000 Received: from mail-io1-xd2f.google.com ([2607:f8b0:4864:20::d2f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s4SBN-001vf8-0Q for pgsql-hackers@lists.postgresql.org; Tue, 07 May 2024 21:17:09 +0000 Received: by mail-io1-xd2f.google.com with SMTP id ca18e2360f4ac-7e17ead542bso79139439f.2 for ; Tue, 07 May 2024 14:17:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715116624; x=1715721424; darn=lists.postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=Iyi7yLHTTEZwrRsVGAsxLds9olosq0Hkvbac/QNPq6I=; b=GDATp/Jjw1c4k9Gtw9++YwNl12EiFR/VOjPggrnWtdZuaxyOHhUpVj9lFgiMV4+F8H c1hAcjN7fMk852TmS3aFt9gF/bvZNha3NDNyrFec2BNW46wqFTi0tqyH7vHBsL2bt/rL /cK+2LAk+MovomMy+H4ZHXBBg4jUzNrcHOTfTZnGK1t0gAZS3W/RxX0xUQS4I+jOgbnB WWaLMGVTTW/8EMCcBPKptnNP/DKJDCkUgS+erzSKwYAQEuGlnPSA4iWenucFoB0xB8+e cYcEjSIMLp7DlXqa7x/w8rTKTOIXTaiti4uRw4xKfbUE4WmEY4eRqD9W+nK/81cGoSat ADog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715116624; x=1715721424; h=in-reply-to:content-transfer-encoding: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=Iyi7yLHTTEZwrRsVGAsxLds9olosq0Hkvbac/QNPq6I=; b=YOFGKoeB9ukYpGk6EFE8AA8s3DtbLyHYUHdYjADh9lANMm2o4XUAnnY8PiClt22d98 wCXWcDU8zjr7m25S74ZQNJfjdGIhP33nXOmxBqMTkHrJzO0v7YtESuyDWqVWWL0i2lO0 TxWqkjCFB4W5fpGTNE6bj6Hk1HaymDRye4m+xtwrffZdxv13l2BdMU6qe93Yw+RuYhIE GZ3yiKNPYFV/ADJX5UNPmDQFHYG2f3S8YK/Kv9+HIxd+S+1hd8X4JZ4jdrZwof1NrNYr DxsAig4C0B3SAnf7gzqgriPHSEW4vAV3EJhjiTDPqM09sqR1FB4n/Emy33WeDXJaXJhj k3dQ== X-Forwarded-Encrypted: i=1; AJvYcCVSYT9WL2pQVIwrSl2Q3v6ERcGRWUt0AracIDBBoR7GbMzOAkYT8W5sZ2y0r2B0qvEoaSIC43leYHsVlGyvdY2wn2apU2Vzlqan5unwWuf431MS X-Gm-Message-State: AOJu0YztQ9FKm6A2oBWwAsavWwuFO9c9ZPtcZKux+VJdBFdTmqCpK2YF zGGCdKgCCm7vlNncz9BRpUf9fXbyeH8KFm8vaWi7dW0xPJPasHjx X-Google-Smtp-Source: AGHT+IFUB+UoYyPbzt2nOKCoSR5mP1AtgLLG7/bbUElA4D3eYcNQptMbAbpPFEsrQJ0wNbX8nPYImQ== X-Received: by 2002:a6b:6f0d:0:b0:7e1:7fd2:676 with SMTP id ca18e2360f4ac-7e18fd577c6mr76716439f.12.1715116624209; Tue, 07 May 2024 14:17:04 -0700 (PDT) Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id ix13-20020a056638878d00b00482c2bcabd5sm3205840jab.2.2024.05.07.14.17.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 14:17:03 -0700 (PDT) Date: Tue, 7 May 2024 16:17:02 -0500 From: Nathan Bossart To: Robert Haas Cc: David Rowley , Joe Conway , Michael Banck , Laurenz Albe , =?iso-8859-1?Q?Fr=E9d=E9ric?= Yhuel , Melanie Plageman , PostgreSQL Hackers Subject: Re: New GUC autovacuum_max_threshold ? Message-ID: <20240507211702.GA2720371@nathanxps13> References: <662b6941.5d0a0220.ea153.4178@mx.google.com> <06b361a6-094c-4d78-b4c9-b102e270d97e@joeconway.com> <7c91df80-ef1b-426a-a2b3-e11ffb31bcc7@joeconway.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, May 07, 2024 at 10:31:00AM -0400, Robert Haas wrote: > On Wed, May 1, 2024 at 10:03 PM David Rowley wrote: >> I think we need at least 1a) before we can give autovacuum more work >> to do, especially if we do something like multiply its workload by >> 1024x, per your comment above. > > I guess I view it differently. It seems to me that right now, we're > not vacuuming large tables often enough. We should fix that, > independently of anything else. If the result is that small and medium > sized tables get vacuumed less often, then that just means there were > never enough resources to go around in the first place. We haven't > taken a system that was working fine and broken it: we've just moved > the problem from one category of tables (the big ones) to a different > category of tables. If the user wants to solve that problem, they need > to bump up the cost limit or add hardware. I don't see that we have > any particular reason to believe such users will be worse off on > average than they are today. On the other hand, users who do have a > sufficiently high cost limit and enough hardware will be better off, > because we'll start doing all the vacuuming work that needs to be done > instead of only some of it. > > Now, if we start vacuuming any class of table whatsoever 1024x as > often as we do today, we are going to lose. But that would still be > true even if we did everything on your list. Large tables need to be > vacuumed more frequently than we now do, but not THAT much more > frequently. Any system that produces that result is just using a wrong > algorithm, or wrong constants, or something. Even if all the necessary > resources are available, nobody is going to thank us for vacuuming > gigantic tables in a tight loop. The problem with such a large > increase is not that we don't have prioritization, but that such a > large increase is fundamentally the wrong thing to do. On the other > hand, I think a more modest increase is the right thing to do, and I > think it's the right thing to do whether we have prioritization or > not. This is about how I feel, too. In any case, I +1'd a higher default because I think we need to be pretty conservative with these changes, at least until we have a better prioritization strategy. While folks may opt to set this value super low, I think that's more likely to lead to some interesting secondary effects. If the default is high, hopefully these secondary effects will be minimized or avoided. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com