Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oRLRg-0001EL-Fm for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Aug 2022 22:35:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oRLRe-0000yp-Tq for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Aug 2022 22:35:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oRLRe-0000yc-3A for pgsql-hackers@lists.postgresql.org; Thu, 25 Aug 2022 22:35:26 +0000 Received: from smtp-fw-33001.amazon.com ([207.171.190.10]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oRLRa-0007vV-GK for pgsql-hackers@lists.postgresql.org; Thu, 25 Aug 2022 22:35:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1661466922; x=1693002922; h=message-id:date:mime-version:subject:to:references:from: in-reply-to:content-transfer-encoding; bh=ywndYKJkp6kmbK1cQOY8kTaGqql2KprPu4rCxEG9dqM=; b=TAioJjg73R1rTfNDU3dUEWzjbCeZYWeM1tyHMjHYABaHPlVRIGRjBZO0 T5677FUkwvNuxcCytYEhmtWMhEbRpOuSU5UyYBuMGlIu3iKrUpXAOGYDj E9HPLgWPnAWE73Z2SRlSkwf5TdmIFThobfkY5G8LHPga0Y8rhu3LGsF8w A=; X-IronPort-AV: E=Sophos;i="5.93,264,1654560000"; d="scan'208";a="221012292" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-iad-1d-8bf71a74.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-33001.sea14.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2022 22:35:20 +0000 Received: from EX13MTAUWB001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-iad-1d-8bf71a74.us-east-1.amazon.com (Postfix) with ESMTPS id 40C85C180D; Thu, 25 Aug 2022 22:35:19 +0000 (UTC) Received: from EX19D018UWC004.ant.amazon.com (10.13.138.168) by EX13MTAUWB001.ant.amazon.com (10.43.161.207) with Microsoft SMTP Server (TLS) id 15.0.1497.38; Thu, 25 Aug 2022 22:35:18 +0000 Received: from [10.111.246.105] (10.43.162.158) by EX19D018UWC004.ant.amazon.com (10.13.138.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1118.9; Thu, 25 Aug 2022 22:35:18 +0000 Message-ID: <4d67ed07-bc37-ac42-3ea6-bcce1db5a38e@amazon.com> Date: Thu, 25 Aug 2022 15:35:17 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: New strategies for freezing, advancing relfrozenxid early Content-Language: en-US To: Peter Geoghegan , PostgreSQL Hackers References: From: Jeremy Schneider In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.43.162.158] X-ClientProxiedBy: EX13D46UWB004.ant.amazon.com (10.43.161.204) To EX19D018UWC004.ant.amazon.com (10.13.138.168) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 8/25/22 2:21 PM, Peter Geoghegan wrote: > > New patch to avoid allocating MultiXacts > ======================================== > > The fourth and final patch is also new. It corrects an undesirable > consequence of the work done by the earlier patches: it makes VACUUM > avoid allocating new MultiXactIds (unless it's fundamentally > impossible, like in a VACUUM FREEZE). With just the first 3 patches > applied, VACUUM will naively process xmax using a cutoff XID that > comes from OldestXmin (and not FreezeLimit, which is how it works on > HEAD). But with the fourth patch in place VACUUM applies an XID cutoff > of either OldestXmin or FreezeLimit selectively, based on the costs > and benefits for any given xmax. > > Just like in lazy_scan_noprune, the low level xmax-freezing code can > pick and choose as it goes, within certain reasonable constraints. We > must accept an older final relfrozenxid/relminmxid value for the rel's > authoritative pg_class tuple as a consequence of avoiding xmax > processing, of course, but that shouldn't matter at all (it's > definitely better than the alternative). We should be careful here. IIUC, the current autovac behavior helps bound the "spread" or range of active multixact IDs in the system, which directly determines the number of distinct pages that contain those multixacts. If the proposed change herein causes the spread/range of MXIDs to significantly increase, then it will increase the number of blocks and increase the probability of thrashing on the SLRUs for these data structures. There may be another separate thread or two about issues with SLRUs already? -Jeremy PS. see also https://www.postgresql.org/message-id/247e3ce4-ae81-d6ad-f54d-7d3e0409a950@ardentperf.com -- Jeremy Schneider Database Engineer Amazon Web Services