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 1tqGyA-002Bqc-Lt for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Mar 2025 19:33: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 1tqGy9-005zan-DK for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Mar 2025 19:33:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tqGy9-005zae-2q for pgsql-hackers@lists.postgresql.org; Thu, 06 Mar 2025 19:33:21 +0000 Received: from mail-il1-x130.google.com ([2607:f8b0:4864:20::130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tqGy5-001M9L-1K for pgsql-hackers@lists.postgresql.org; Thu, 06 Mar 2025 19:33:20 +0000 Received: by mail-il1-x130.google.com with SMTP id e9e14a558f8ab-3d284b9734fso8589325ab.2 for ; Thu, 06 Mar 2025 11:33:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741289597; x=1741894397; darn=lists.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=uvmZUbHeiE7SWLRG0DD0aY/K2Dd052FpKBSLhrfnkCM=; b=Hu3Lq/Pa4V8/QZjc8FH8P95tA1ptZf6JC5Fm9a/xXLFligMq+hsv6WJ9A7LEhdUUwX EGuDkqm2/w8f8AuMJ5bf/UE/E53srcWjo4H5YL0nvwee+gM1855jpsk4RYiyYUEI8RtD IgBc+v1QFMXzXsDZYo4a9HgEodyizmNPaznpy/ABV/IBGTuIMLd9HHeuVdnbgmInqIjn fQgtKtE4sL4DVcOYPq1Br/Y8fypoG8Ci14fa2Dz1tQ+rnzoTjzrHlUaeAhQUv6nrymJB 4r9CUl6YY3h0BxSvCMPpaZKBotnSU9LwpzLgtepVqn1VlwZIZNyfx8NKDMHLtZzMGyTm Qg9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741289597; x=1741894397; 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=uvmZUbHeiE7SWLRG0DD0aY/K2Dd052FpKBSLhrfnkCM=; b=PA9y78i8WU8dzDpQtYcWUvc4DFcWHIcYxo+dUnKkqgpVNbKN7m2h2zBMFHWQkpIT+6 BOURHSwKFtpS8RalRxucJPeSy6qU3XrQXqPqnsxxTQ2jC8ItaVQyxP6z7u8Athyb306q ZGDTPrB3Z9QF53iec6f7mgAUddWBoEKKllGQDCkdqhAIvEz3n70fyDFqLsw7fdB//0JV ZwAUCcspe98MTka3V4b8IpTv+NgY1bChKYJ7TuyGg8wh+yupnoE3iWawd3FoItGZkwkg jSguUFq0L96ykYpZ3p11KzG95ft88Gpzk6QCIBJLZfxl0LLhjImaBy51Gm/c5VUTh7tZ VFRA== X-Forwarded-Encrypted: i=1; AJvYcCV37JP2dFbKOf+beJt1wHBRVHnauPjd2/CFhD/nhP2ph6NXq9mdo+po7GaFXMBE5gsWd1bTRJy/FfXvxYcO@lists.postgresql.org X-Gm-Message-State: AOJu0Yy2HcgpxH/kUOkTB5rebMc9mWrEJo/ndzITbG4g6T3L643y5Zo6 IHGmY2THP0/NCooPB8F7iJWuVkH2jncPRIvANfK460jYUsaYP0F2 X-Gm-Gg: ASbGncvJny7W4PpXAZvwr24gv6+6c9jaPgVJUhZRT3JijeGvY8M2FyZzWzGjndh4u4H gGjN5p0pCz3/G5f2KNO0Uz+V49qofaZ6ncIk1PL5W2yDqMIpuQHndT1f50DeRby4OklQrm99XZg Ep8swAQPx/jGDgnKgAgwYKcDGPK9fO1yKzDetIYaiWYRTFN5A/IhPtT5AxdScWSpkq48uT3Zpfo zte7N2q+Qf4AQgc0iZ7GC5aJV2BYJW+FXlMH6mZuctY32Ku5HZH7+pcHtM2tJBMa4cnv8d+D8Ul Ey5t+OUp290BAkyFlqHUYKnVOqxAombYXYk2iGiVdQERzetdB1H7/rsoUrTTEQZAaeXX3HBWMkF 8/N9CAZqSqbeFfVVc5CZFsO3EV18lW6Juwt0= X-Google-Smtp-Source: AGHT+IES3D7k2l9zGq2rov79aIW4J9oohJUGZ03VusYKtyZEtDGW04B3u8uXpe13DR1K9Of6zYiOhw== X-Received: by 2002:a05:6e02:1848:b0:3d4:2ea4:6b8a with SMTP id e9e14a558f8ab-3d441a0571cmr11972775ab.22.1741289596921; Thu, 06 Mar 2025 11:33:16 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3d43b4f6a44sm4391115ab.18.2025.03.06.11.33.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Mar 2025 11:33:16 -0800 (PST) Date: Thu, 6 Mar 2025 13:33:13 -0600 From: Nathan Bossart To: Tom Lane Cc: Andres Freund , Corey Huinker , Robert Haas , Jeff Davis , Michael Paquier , jian he , Bruce Momjian , Matthias van de Meent , Magnus Hagander , Stephen Frost , Ashutosh Bapat , Peter Smith , PostgreSQL Hackers , alvherre@alvh.no-ip.org Subject: Re: Statistics Import and Export Message-ID: References: <6rpmhyrtci4epuzay7y5xvd2cwdwb6zmtt6ofxrvakyawxhm7s@6grajbpr4kij> <714295.1741286854@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <714295.1741286854@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Mar 06, 2025 at 01:47:34PM -0500, Tom Lane wrote: > 1. pg_upgrade has made a policy judgement to apply parallelism across > databases not within a database, ie it will launch concurrent dump/ > restore tasks in different DBs but not authorize any one of them to > eat multiple CPUs. That needs to be re-thought probably, as I think > that decision dates to before we had useful parallelism in pg_dump and > pg_restore. I wonder if we could just rip out pg_upgrade's support > for DB-level parallelism, which is not terribly pretty anyway, and > simply pass the -j switch straight to pg_dump and pg_restore. That would certainly help for clusters with one big database with many LOs or something, but I worry it would hurt the many database case quite a bit. Maybe we could add a --jobs-per-db option that indicates how to parallelize dump/restore. If you set --jobs=8 --jobs-per-db=8, the databases would be dumped serially, but pg_dump would get -j8. If you set --jobs=8 and --jobs-per-db=2, we'd process 4 databases at a time, each with -j2. -- nathan