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 1s7mKV-007Mwr-4g for pgsql-hackers@arkaria.postgresql.org; Fri, 17 May 2024 01:24:16 +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 1s7mKU-002EWj-Di for pgsql-hackers@arkaria.postgresql.org; Fri, 17 May 2024 01:24:14 +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 1s7mKU-002EWb-1Z for pgsql-hackers@lists.postgresql.org; Fri, 17 May 2024 01:24:14 +0000 Received: from mail-il1-x12c.google.com ([2607:f8b0:4864:20::12c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s7mKR-000aIA-9G for pgsql-hackers@postgresql.org; Fri, 17 May 2024 01:24:12 +0000 Received: by mail-il1-x12c.google.com with SMTP id e9e14a558f8ab-36cc8dbe09aso4744725ab.2 for ; Thu, 16 May 2024 18:24:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715909050; x=1716513850; 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=CFVy87T/P71dQlye/TLttChzoIwoQ7x9o3ASzz4mloo=; b=QR3owQfb6YGTqGKSwkFMfd3JMu6NawSd07C4oLU/tR48Rgo4yIgc1iN5UTaOoHXWHb 90Fbyx86Nht29ZDBLRueByHRrWRclXIw3GJAbHUwbZ9kp3+KAkrJwoZIMqoZdDgC8CSE ZY7cbrRXi6DJehd6Nxu2E32VunaWHkFhf99piXombYzkA0ZrIIzVFxxfUDI1QyHT+Elk lGmfp8h9WaH8QW9AcwrIvCv8ElN8hPuGF63JyHwOLb5O+f6Tl5TaNy3GgoOXHED8joui nXf8q/DftX+H6hkiYKfyX3LMFfi/25A3t3vEayh68DFLTgO7cp7nZqtiZSoUsW7YO+hy YnvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715909050; x=1716513850; 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=CFVy87T/P71dQlye/TLttChzoIwoQ7x9o3ASzz4mloo=; b=Xtx9DaG1yxp9s5Q6XWaKoBp6PpVUCgXjozgGpTsoe/1oBQWtSqkoU0jdnqrz4FNrTw RkgKXJ/5gBP9wLlCNvlS9tLCB4IujRpLyUMNgPFw6Dvjf185iYoml1Dq6xz15gLrViRE HCD4ERtXbjdAu07CL676VwsI96bvAJ57IuoI1o06zagMdbAuP4uSfbpvreCgGMGHXM7R CJ8Qv6QPgjiKToEMJY6zkB3S0rFJH3rfGEJ5Xz1T40PvKXqLxbk+2Eyb0qBP/MSy5OTF sRV87+972TRytggu+kwAJzA54nt+dfALsK1E4ZDXuR3VDc1EIIxzk4Xil4xARu5LPMwY WvoA== X-Gm-Message-State: AOJu0YxgedVsjzcJ5LRKOWd8aFnxNw99qi9f9ZSCkiRCtKOQbfCfBnw8 khsubcUXQ08N+W7HE/WVMonMbeLRM8wbjAgWwDVGjWfw4kO4J0XL X-Google-Smtp-Source: AGHT+IEqfxA9DFrpJQ1TuIfoX3Pujdv4F3ctJN4J4sMgaiN84GgF9IA9G+PxuqSiR3gAQKiiFUSc+w== X-Received: by 2002:a92:ca0f:0:b0:36c:c5ca:9f9b with SMTP id e9e14a558f8ab-36cc5caa0d8mr250950165ab.14.1715909050477; Thu, 16 May 2024 18:24:10 -0700 (PDT) Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-489376dc8casm4300371173.139.2024.05.16.18.24.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 18:24:10 -0700 (PDT) Date: Thu, 16 May 2024 20:24:08 -0500 From: Nathan Bossart To: Jeff Davis Cc: pgsql-hackers@postgresql.org Subject: Re: optimizing pg_upgrade's once-in-each-database steps Message-ID: <20240517012408.GA1691322@nathanxps13> References: <20240516211638.GA1688936@nathanxps13> <3b97ab8e295ec3db22baa2dfdd49073449ae1696.camel@j-davis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3b97ab8e295ec3db22baa2dfdd49073449ae1696.camel@j-davis.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, May 16, 2024 at 05:09:55PM -0700, Jeff Davis wrote: > How much complexity do you avoid by using async instead of multiple > processes? If we didn't want to use async, my guess is we'd want to use threads to avoid complicated IPC. And if we followed pgbench's example for using threads, it might end up at a comparable level of complexity, although I'd bet that threading would be the more complex of the two. It's hard to say definitively without coding it up both ways, which might be worth doing. > Also, did you consider connecting once to each database and running > many queries? Most of those seem like just checks. This was the idea behind 347758b. It may be possible to do more along these lines. IMO parallelizing will still be useful even if we do combine more of the steps. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com