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 1rG9Xq-00DzOa-7J for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Dec 2023 03:16:22 +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 1rG9Xo-002Smq-Sk for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Dec 2023 03:16:20 +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 1rG9Xo-002Slq-IZ for pgsql-hackers@lists.postgresql.org; Thu, 21 Dec 2023 03:16:20 +0000 Received: from mail-il1-x12e.google.com ([2607:f8b0:4864:20::12e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rG9Xl-00BQtR-Vi for pgsql-hackers@postgresql.org; Thu, 21 Dec 2023 03:16:19 +0000 Received: by mail-il1-x12e.google.com with SMTP id e9e14a558f8ab-35fceb46c5fso948665ab.0 for ; Wed, 20 Dec 2023 19:16:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703128577; x=1703733377; 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=l5btX+4vJDy64RefkaRqVARrYz+qBMHX/K0Q9HGNRMk=; b=fqb0ozNIMjiaVKiSHP5jg3yxGeCUotBGGwCRAb8aUzl+4k9bXcbttLth17Polwg+aL IiLTSu21otnDGTq9Zqs5IGnNJ2Z6qvSbbswRI1mCNrQl8OlgQlK1Jv3R3M/JIzS9jFU8 7NoTAxi6K0WqVifvyKcJ4YJH/u6TlZDVUyNhikC8W4KjVzS7+k+xV6yz42i8HLaHpC1T F1MrizRcp2Z6+DdvA6g9ECqJimO51jlmeYesVULUAy2tM5TyQs+RcuWV6RS3gejRNT1Z BjWZEdRasGLMlBC8vOPftykyUbt/s0k/hLM+7qHHH9Pr07Eh4mwzEuvm3CkFqbXOdUHV HzUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703128577; x=1703733377; 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=l5btX+4vJDy64RefkaRqVARrYz+qBMHX/K0Q9HGNRMk=; b=V33reL1IKdd+ScBRDp/fquLi1tjwiPF74EU0RIYdGYjS1coJxVD8ZKCoLUZEFJIpgn NBbyyhdKMdFo4AQkWlQPoU97dOl3Gk3xI3x3kTOQrJiDZQ6l88pWZdCRRSEc76KrbX/V 4N7UCDQmrY3ad7ceNb/mc6qgpGe4Ytlk2gSrq0l6nk3cajLsnTS8yzbAszpC8sg17tVU crwJi2nW0u+fWktNKZ3B3iEwKu2OSp28MZqR+7qFO3l0gpSNeSnz7RL8/ZJBQT5XeLRE p2QV5Giy5afraC3DTgqKMMUXr3BxVSyKgO/e+BPNYKcNwChFUu5bRjNxRIRJrmxIFeTu jSAg== X-Gm-Message-State: AOJu0YxpoXUngGGrjBcb/63SWfaq6TYBdOFwz7KT9UO8EEgyAzDsqHB/ riDEwe+mo97jqMAH5/zErXI= X-Google-Smtp-Source: AGHT+IEk8zmttAmTt4sG4zV/c1pffR/ynoJF3wTFyPyWQArIn8UoHPsirOkUFNr6q4Hw8pkNRsL42w== X-Received: by 2002:a05:6e02:1d18:b0:35f:8232:5e16 with SMTP id i24-20020a056e021d1800b0035f82325e16mr31961ila.15.1703128577050; Wed, 20 Dec 2023 19:16:17 -0800 (PST) Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id b18-20020a92db12000000b0035f79e0a932sm251677iln.41.2023.12.20.19.16.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 19:16:16 -0800 (PST) Date: Wed, 20 Dec 2023 21:16:14 -0600 From: Nathan Bossart To: Tom Lane Cc: "Kumar, Sachin" , Jan Wieck , Bruce Momjian , Zhihong Yu , Andrew Dunstan , Magnus Hagander , Robins Tharakan , Peter Eisentraut , "pgsql-hackers@postgresql.org" Subject: Re: pg_upgrade failing for 200+ million Large Objects Message-ID: <20231221031614.GA836232@nathanxps13> References: <663393ca-b2ff-26f0-2e2d-adc942aff4fd@timescale.com> <20220908231807.GA2242918@nathanxps13> <0643CC11-223A-4039-AC34-94E127462796@amazon.com> <1152134.1699555261@sss.pgh.pa.us> <83D44BE5-0088-4D41-8AE6-20A05D026F46@amazon.com> <81D13E16-BA04-43CF-9B89-B8924300B211@amazon.com> <240D05EC-8B28-4112-BEAB-85ECBAF3F871@amazon.com> <2055911.1702258962@sss.pgh.pa.us> <534746.1703116064@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <534746.1703116064@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Dec 20, 2023 at 06:47:44PM -0500, Tom Lane wrote: > I have spent some more effort in this area and developed a patch > series that I think addresses all of the performance issues that > we've discussed in this thread, both for pg_upgrade and more > general use of pg_dump/pg_restore. Concretely, it absorbs > the pg_restore --transaction-size switch that I proposed before > to cut the number of transactions needed during restore, and > rearranges the representation of BLOB-related TOC entries to > reduce the client-side memory requirements, and fixes some > ancient mistakes that prevent both selective restore of BLOBs > and parallel restore of BLOBs. > > As a demonstration, I made a database containing 100K empty blobs, > and measured the time needed to dump/restore that using -Fd > and -j 10. HEAD doesn't get any useful parallelism on blobs, > but with this patch series we do: > > dump restore > HEAD: 14sec 15sec > after 0002: 7sec 10sec > after 0003: 7sec 3sec Wow, thanks for putting together these patches. I intend to help review, but I'm not sure I'll find much time to do so before the new year. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com