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 1scQqd-007E7R-Dz for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Aug 2024 14:44:07 +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 1scQqb-003shc-Fl for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Aug 2024 14:44:05 +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 1scQqb-003shU-64 for pgsql-hackers@lists.postgresql.org; Fri, 09 Aug 2024 14:44:05 +0000 Received: from mail-il1-x136.google.com ([2607:f8b0:4864:20::136]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1scQqY-003tk0-G0 for pgsql-hackers@postgresql.org; Fri, 09 Aug 2024 14:44:03 +0000 Received: by mail-il1-x136.google.com with SMTP id e9e14a558f8ab-39b3a4d2577so7026445ab.3 for ; Fri, 09 Aug 2024 07:44:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723214641; x=1723819441; 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=W4f8G/NFqDkJvIt3Y3AHsU9Ypnq45eoVvGY9u0saM4U=; b=dY972frfx6KZFAHtUN0FFET6Tr8m9EJg8nlQ9S+uUlQAjWi417dCqpwQmgjX5bRBBg PmS7LBfORnhSY1zT1G7o0CzD+lmwJ76yNeumiTEQC1r/mlX65t7Hr+WpEeGzzv2g9CWj 8QuRvvDUng9aA2kPqpJwPlivnD5oEN92/cSku6ofc6YHfKmc06fXjLfzdBDIrBYHGcOp HqVZqaSU8GmqBLfoiy+dD8DRQEFnID55btzXlQSEmC9aww87alpjcfh+Qh745H9DZen5 /86INYQXs3ZDED2s+yWRojy7yq0MeDW7rcdbq5xNvvX4EPs8F3B4DpavWfKaXBCA3Wt/ tddQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723214641; x=1723819441; 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=W4f8G/NFqDkJvIt3Y3AHsU9Ypnq45eoVvGY9u0saM4U=; b=DPKEOPm4L0xUEUqeyz+qBEDGdhRlN6tYHoq/s7SFXfZatsm9WtGWL+IhoBdkf0rv1L jhUtdMQqeXEVNLADXjjRSajfJ5eRFrLoXlYz19tzC2sertguZ0M7P1hFs4xW5T+AV0hU zNSNHJntU6xc7ioDSNn2KvxuyZH0g4U1JKlDaGjMBy400J7mKMkR02OFsP5vGQY67W+d 7+sOpkLWUIORn5pmYjMH4eX0eGmh+fXYii+kogEpNljMVv7HoeDq3wND8m3KdlXnJdmB hYoZ7usyKOnrANOUWxZgkgr4hCLZ+7DVeqPlclXsh2WjWJ8VCIsehjG4vLUhi18Fn7Qu Cprg== X-Forwarded-Encrypted: i=1; AJvYcCWJp8AF3b0wRjAjWa3+AsCKR8mRAPOcSX4dSNeUK45bNLXq07regZAr/1vt3WBTHD4dcb51UnfSJXddj8axpyemYNL9e/7at/3URdIC X-Gm-Message-State: AOJu0Yw/RTw8xb+5ZiJpm4Ad/zLBbDzQAC8z92QolkwwUlg3448dyVys 79HXLQHs+KPplpd1oGpxv3bWYe2rz3xknTKAlbgb4LfhkC/7//BZ X-Google-Smtp-Source: AGHT+IHXlawUqLuQH5eyiCETt7YQtQ4vYi0yK2cXYZ+iWBp0iOdW/AerK/kQQL0lMrTewMU1PEt8xQ== X-Received: by 2002:a05:6e02:b4a:b0:398:39f:8b4d with SMTP id e9e14a558f8ab-39b748539cbmr23414245ab.5.1723214641454; Fri, 09 Aug 2024 07:44:01 -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-4c8d6a2738csm4182512173.98.2024.08.09.07.44.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Aug 2024 07:44:01 -0700 (PDT) Date: Fri, 9 Aug 2024 09:43:59 -0500 From: Nathan Bossart To: Corey Huinker Cc: Ilya Gladyshev , Daniel Gustafsson , Robert Haas , Jeff Davis , PostgreSQL Hackers Subject: Re: optimizing pg_upgrade's once-in-each-database steps Message-ID: References: <4493D323-9726-48F7-A702-E71FB991F76B@yesql.se> <10c1c8dd-4685-46d4-80be-56bdfca8659a@gmail.com> <60cbc507-4c36-4037-9af7-028b1c8455b5@gmail.com> 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 Thu, Aug 08, 2024 at 06:18:38PM -0400, Corey Huinker wrote: > I think the underlying mechanism is basically solid, but I have one > question: isn't this the ideal case for using libpq pipelining? That would > allow subsequent tasks to launch while the main loop slowly gets around to > clearing off completed tasks on some other connection. I'll admit I hadn't really considered pipelining, but I'm tempted to say that it's probably not worth the complexity. Not only do most of the tasks have only one step, but even tasks like the data types check are unlikely to require more than a few queries for upgrades from supported versions. Furthermore, most of the callbacks should do almost nothing for a given upgrade, and since pg_upgrade runs on the server, client/server round-trip time should be pretty low. Perhaps pipelining would make more sense if we consolidated the tasks a bit better, but when I last looked into that, I didn't see a ton of great opportunities that would help anything except for upgrades from really old versions. Even then, I'm not sure if pipelining is worth it. -- nathan