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 1sH3yP-002gaA-GS for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Jun 2024 16:03:50 +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 1sH3yN-007fUx-Bn for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Jun 2024 16:03:48 +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 1sH3yN-007fUo-1r for pgsql-hackers@lists.postgresql.org; Tue, 11 Jun 2024 16:03:47 +0000 Received: from mail-oa1-x32.google.com ([2001:4860:4864:20::32]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sH3yL-000oji-Ah for pgsql-hackers@postgresql.org; Tue, 11 Jun 2024 16:03:46 +0000 Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-254ab6d5745so647827fac.3 for ; Tue, 11 Jun 2024 09:03:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718121824; x=1718726624; darn=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=xSS7jlzGWNaPeoZZ+5G9VCjlP9Ht26Wg4AYV477L85Q=; b=CRLmytsA9lLoiHqcC5pRTdH0A3NeIM220CZE4GWpZDgXEkYKcKfldNqdcvJ/xenlVd sIAHj7EifUy++88YemcZyikMkPDrmUAmZRHy6RRsoba+G/3cO1DaMTAT7u9Ckr+P6ri5 P6tSv/uat7hqIlWZ565t2VKXvXQO0F/kjLnEBEp5WrxjKU5hysjKCDrOwOfd/H4K2uBl 4rXUoMMvwS67GJ/R9pHTHeEAIKpQEwnonTaTg4k1P2xmozMe2CmPm5vCV358hNf2JLMP zPmlzl7vh80GQknMo56K2j0nzPyhKVxWswJUrF1bS9GUZAt6FGA51MYj/o2EvrlB+zka jnOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718121824; x=1718726624; 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=xSS7jlzGWNaPeoZZ+5G9VCjlP9Ht26Wg4AYV477L85Q=; b=JbRCvapmRDN7uQ0bdmVG8dQeLzIKTTakIdgA4Ny2UB4WaiRNavCKvbvc7Q8a+t92Iy NRr8JCsl4LUdcyfJINWCr11lUvrd2+kcNmaifdhGJTTrp6Zlk9nrlrKeEbbno5hUGo3a qyLNgG1MOLaRkrpCBYqjGifj92If/54cU9UcYJSKXrB79k33/+bo4z8v5+lmvO2uPPpJ Z9YtXuQ+1amrdm3S8jIvxl6XPR96kZXK/bo/v6kj+vYWtXHcgNqmIazipmWXW1IVqCC2 k+tnUz7BPwkp0aDEYKkKHj3vT3at44IK9BgwC+XAEAGKdF9+hhIw61dXEXa9JGlvlDlQ iRJQ== X-Forwarded-Encrypted: i=1; AJvYcCXAdrKhfxwb6J3aW2E0mk2h2Ph5RZ1MmR6eDNNVw3UIc5DQM6+puQp2+KiWE1ZHtcNnDEWy/l+HkLcI8D/rlaNpdTMhDD6tKDqsJujM X-Gm-Message-State: AOJu0Yzk7iYU+hdoxo9gMu8XenVZwlRdeHem/JatXOFNZtUAtK2wwxbW 2+pgCV1BuQrEI9J0WTPID43Se9MO1q7S2nUQUhAvoljxwztokfgu X-Google-Smtp-Source: AGHT+IGsRblXUNkdmg1H8r8oxikMHR2C9QVJDVMW2fIBvMa/Ijw57nnCz0V1FtwOADGGCnvZ9zB2hw== X-Received: by 2002:a05:6870:32d0:b0:24d:9c4d:f609 with SMTP id 586e51a60fabf-254647f0af2mr13060492fac.38.1718121823262; Tue, 11 Jun 2024 09:03:43 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b9123b53b5sm1450351173.103.2024.06.11.09.03.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 09:03:42 -0700 (PDT) Date: Tue, 11 Jun 2024 11:03:41 -0500 From: Nathan Bossart To: Matthias van de Meent Cc: Dilip Kumar , Ranier Vilela , pgsql-hackers@postgresql.org Subject: Re: use CREATE DATABASE STRATEGY = FILE_COPY in pg_upgrade Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Jun 11, 2024 at 10:39:51AM +0200, Matthias van de Meent wrote: > On Tue, 11 Jun 2024 at 04:01, Nathan Bossart wrote: >> I did a handful of benchmarks on an r5.24xlarge that seem to prove your >> point. The following are the durations of the pg_restore step of >> pg_upgrade: >> >> * 10k empty databases, 128MB shared_buffers >> WAL_LOG: 1m 01s >> FILE_COPY: 0m 22s >> >> * 10k empty databases, 100GB shared_buffers >> WAL_LOG: 2m 03s >> FILE_COPY: 5m 08s >> >> * 2.5k databases with 10k tables each, 128MB shared_buffers >> WAL_LOG: 17m 20s >> FILE_COPY: 16m 44s >> >> * 2.5k databases with 10k tables each, 100GB shared_buffers >> WAL_LOG: 16m 39s >> FILE_COPY: 15m 21s >> >> I was surprised with the last result, but there's enough other stuff >> happening during such a test that I hesitate to conclude much. > > If you still have the test data set up, could you test the attached > patch (which does skip the checkpoints in FILE_COPY mode during binary > upgrades)? With your patch, I see the following: * 10k empty databases, 128MB shared_buffers: 0m 27s * 10k empty databases, 100GB shared_buffers: 1m 44s I believe the reason the large buffer cache test is still quite a bit slower is due to the truncation of pg_largeobject (specifically its call to DropRelationsAllBuffers()). This TRUNCATE command was added in commit bbe08b8. -- nathan