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 1t9T2D-00AN8n-Ce for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Nov 2024 17:44:36 +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 1t9T2A-00Be5X-4H for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Nov 2024 17:44:34 +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 1t9T29-00Be5N-QS for pgsql-hackers@lists.postgresql.org; Fri, 08 Nov 2024 17:44:34 +0000 Received: from mail-io1-xd2b.google.com ([2607:f8b0:4864:20::d2b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1t9T23-000qCC-J1 for pgsql-hackers@lists.postgresql.org; Fri, 08 Nov 2024 17:44:32 +0000 Received: by mail-io1-xd2b.google.com with SMTP id ca18e2360f4ac-83aac75fcceso82989139f.0 for ; Fri, 08 Nov 2024 09:44:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731087867; x=1731692667; darn=lists.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=vRrNqDvStYwy4FEbXpGPC7lBD6vrBBwh0XTyQzqdugU=; b=QDYwP76/R8PbQ/tW687u72RiiV3OstbRJjFHYgtpcqh7x+1EfhGYc79zWJQBlNU47Q oKxHK92Mc+UGBNWNdY+yuz1GU+5tXoX2uGBLr0TkOXJ5Rf6K0ikhC3+aD2yNCZ3cpUyr 1pw9UHOkXLXmM6bRB5KWLeppIXqVAFE9y/V3n4XZjXkEbuCx9KZSWILVkeii+bVY+mDq Li/kfy2KCzycyWS0zVuwTCujmawa5D5Rhb/fcBSgVnhVfdn4n2F+QvNUnpHchHwedQMb MvJbYCu91yIZBk8nD1fR/Kf3Uc9oZVUD+Az8cOzd8+2qEY7Skkh+0sxLv6SkTizXZmS4 OfCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731087867; x=1731692667; 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=vRrNqDvStYwy4FEbXpGPC7lBD6vrBBwh0XTyQzqdugU=; b=wcjPiITuLCt5sn0l7owmFZ3gSeMG3xjF97A5vZ+AKV52zo/frgiZlCOtzsKZiqEQ7o V4TmbMeN3tMFMLLnKNct9fcjuHAPXI/z9PmUeT6CJ8PsKR0EY3sm4vOd+KOovdcB+jAE 6xev7arcdZE9AKdxotOjoRanDsAno3NYA7N+GIOSbiKFuBbbUd/lTuCs8koqU6FH5CA7 dT0VqSJ+xxNoTsueRZn5Psz2NCk2HKXOm28W2nLcLQB7z8UMbVZdy8/FMEJV4ZcsuXu2 3HdUrioR7dP7UmcaRU5huf6k3H23P4LlsGO6nJv4t1pL+OkTGhlz1WF9EjdFfpEIR/H4 0rKA== X-Forwarded-Encrypted: i=1; AJvYcCUnl577io2zwAhzBaTuQgC88/MI6/HZaOrCpG4heihqytRE6yLDEr/n1qVsyJtJycyHna0LZNVS23Ra/gCY@lists.postgresql.org X-Gm-Message-State: AOJu0Yyp7ovkO0xwSNDK9rE9Z5aUyFtQxjgW0p1WbmtZW4CPIZTnPNlP sWRJRdGYz4hhMsjbDsNtbVeyzzetKXLjl++z8lxVaFcXSSLISnhe X-Google-Smtp-Source: AGHT+IETV7h85HulS7EnyjdPk0517w7/INBGO2t3EatppU8VDi6/w0fq6VN2jJCaeaIAq9uUWFhm8w== X-Received: by 2002:a05:6e02:1a0f:b0:3a6:aa59:fffa with SMTP id e9e14a558f8ab-3a6f19cad30mr41263105ab.11.1731087866690; Fri, 08 Nov 2024 09:44:26 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4de5f8e40aasm940007173.128.2024.11.08.09.44.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2024 09:44:26 -0800 (PST) Date: Fri, 8 Nov 2024 11:44:24 -0600 From: Nathan Bossart To: wenhui qiu Cc: =?iso-8859-1?Q?Fr=E9d=E9ric?= Yhuel , Robert Haas , "Imseih (AWS), Sami" , David Rowley , Joe Conway , Michael Banck , Laurenz Albe , Melanie Plageman , PostgreSQL Hackers Subject: Re: New GUC autovacuum_max_threshold ? Message-ID: References: <20240507211702.GA2720371@nathanxps13> <0A799687-DE0A-4BFC-8900-E1D57EB6C211@amazon.com> <97f04e09-a08a-417c-b65d-5d5cbdd0b845@dalibo.com> <6a2ac9b7-6535-4bb1-8274-0647f7c31c82@dalibo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Nov 06, 2024 at 08:51:07PM +0800, wenhui qiu wrote: >> Thank you. FWIW, I would prefer a sub-linear growth, so maybe something >> like this > >> vacthresh = Min(vac_base_thresh + vac_scale_factor * reltuples, >> vac_base_thresh + vac_scale_factor * pow(reltuples, 0.7) * 100); > >> This would give : > >> * 386M (instead of 5.1 billion currently) for a 25.6 billion tuples > table ; >> * 77M for a 2.56 billion tuples table (Robert's example) ; >> * 15M (instead of 51M currently) for a 256M tuples table ; >> * 3M (instead of 5M currently) for a 25.6M tuples table. >> The other advantage is that you don't need another GUC. > Argee ,We just need to change the calculation formula,But I prefer this > formula because it calculates a smoother value. > > vacthresh = (float4) fmin(vac_base_thresh + vac_scale_factor * > reltuples,vac_base_thresh > + vac_scale_factor * log2(reltuples) * 10000); > or > vacthresh = (float4) fmin(vac_base_thresh + (vac_scale_factor * reltuples) > , sqrt(1000.0 * reltuples)); I apologize for the curt response, but I don't understand how we could decide which of these three complicated formulas to use, let alone how we could expect users to reason about the behavior. -- nathan