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 1t9nsP-00CHno-HF for pgsql-hackers@arkaria.postgresql.org; Sat, 09 Nov 2024 15:59:52 +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 1t9nsM-002Nac-V9 for pgsql-hackers@arkaria.postgresql.org; Sat, 09 Nov 2024 15:59:51 +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 1t9nsM-002NZD-I6 for pgsql-hackers@lists.postgresql.org; Sat, 09 Nov 2024 15:59:51 +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.94.2) (envelope-from ) id 1t9nsI-0012kN-PQ for pgsql-hackers@lists.postgresql.org; Sat, 09 Nov 2024 15:59:50 +0000 Received: by mail-io1-xd2e.google.com with SMTP id ca18e2360f4ac-83abcfb9f37so132737539f.1 for ; Sat, 09 Nov 2024 07:59:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731167985; x=1731772785; 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=41qPjaSMfbMiukFwfXXwZ86iGtnHqZ4Y0lXq11+LGcA=; b=bWn1k8GHUSDf6Dk7INqAyn7authUnxhnJFQexxJif2C3zVbw3ZYErWiErf22B9kaEt V/nmNA2bD1XZqo5rCYHKbC4L3i/3pZQV02l/ZXltTbMd8uAwBO7/Z4HDLU7P9etdzzLo lkz2bG04DCv9m2eXGIg3CaOR04L+a5pZQlKSUyMVwhFt5gLXH2eAx9NYe3W09UnFusz0 DKdzbgDobghe7rGaW4kDHuTrir3czPkOkhed7AzMqB7QXSLX7SdTWaCxJEI0Dhql3CTC f3W/T1VhwCtRC0tjN32B1QiVNNAIEzeiJfCJAZhGaTrNcAgEr3HC22dtuhd0bOyT64iX Htag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731167985; x=1731772785; 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=41qPjaSMfbMiukFwfXXwZ86iGtnHqZ4Y0lXq11+LGcA=; b=If3qO5XGGNOxlsqDwbYxSTay9uTE11iLhBuMLlZfIfCTCZWu8Z8vQEJ1NOcluQcVsE F1iPAj/01geQ3G130itMHlsEwDTvyDyg+djsWK2EYH58PQNFwWpVeX3dRshueG/MiLZX mIlM3bVEWo2Dkmjp4lukYbVQBfEMgGzaM/iPkw/tzmY1VQ2ByI03jwHAxQHkifEXIDfL kDLI0hXCrZKpnpCUb79IhjpmNA4PRFDrqhYMHWckEoWReI+W7nLWE9EoUt0xIz8Pu9k0 qowg5eVE3cZzxbWpCoIKLitX+mHZVNL8C5WwcSJGsZySodLw4Zh0QV9A8votPEMh8Zvh ADbA== X-Forwarded-Encrypted: i=1; AJvYcCW0oBeuUMIlzlXnf1jr0vhXW4Gq124bdQL7P+wbyPmMAABKgYHptxBM5ZswY9G0oQBWrTRvPhFngPEtyx1o@lists.postgresql.org X-Gm-Message-State: AOJu0YwyvErbRUH1lyIXDSINvV320NHFK71qarQO4nMZBQqOhO5prB7m UcEUameECf6TCfqD30vzzK16ftZLv3Jec9WE8I8STp3utiWPqyI9 X-Google-Smtp-Source: AGHT+IEh8l0R198INIIQ1AJzQUvdjN8QSSRZq4gcv8eYaqn+BL570VmKmVHMugVDv81jzeMo18tzog== X-Received: by 2002:a05:6602:134b:b0:82c:f85a:4dcb with SMTP id ca18e2360f4ac-83e032b0ae8mr770328539f.6.1731167985204; Sat, 09 Nov 2024 07:59:45 -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-4de787f0ab4sm391993173.127.2024.11.09.07.59.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Nov 2024 07:59:44 -0800 (PST) Date: Sat, 9 Nov 2024 09:59:42 -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: <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 Sat, Nov 09, 2024 at 10:08:51PM +0800, wenhui qiu wrote: > Sorry ,I forgot to explain the reason in my last email,In fact, I > submitted the patch to the community,(frederic.yhuel@dalibo.com) told me > there has a same idea ,so , > Let me explain those two formulas here,about ( vacthresh = (float4) > fmin(vac_base_thresh + (vac_scale_factor * reltuples), sqrt(1000.0 * > reltuples)); A few days ago, I was looking at the sql server > documentation and found that sql server has optimized the algorithm related > to updating statistics in the 2016 ,version,I think we can also learn from > the implementation method of sql server to optimize the problem of > automatic vacuum triggered by large tables,The Document link( > https://learn.microsoft.com/en-us/sql/relational-databases/statistics/statistics?view=sql-server-ver16 > ),about ( vacthresh = (float4) fmin(vac_base_thresh + vac_scale_factor * > reltuples,vac_base_thresh+ vac_scale_factor * log2(reltuples) * 10000);)I > came to the conclusion by trying to draw a function graph,I personally > think it is a smooth formula AFAICT the main advantage of these formulas is that you don't need another GUC, but they also makes the existing ones more difficult to configure. Plus, there's no way to go back to the existing behavior. -- nathan