Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h8XbY-0007PR-GS for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Mar 2019 21:58:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h8XbW-0003Zk-SU for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Mar 2019 21:58:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h8XbW-0003Zc-HI for pgsql-hackers@lists.postgresql.org; Mon, 25 Mar 2019 21:58:02 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h8XbT-0005J5-U2 for pgsql-hackers@lists.postgresql.org; Mon, 25 Mar 2019 21:58:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x2PLvofe030471; Mon, 25 Mar 2019 17:57:50 -0400 From: Tom Lane To: jesper.pedersen@redhat.com cc: Robert Haas , "Jamison, Kirk" , Alvaro Herrera , Michael Paquier , Peter Eisentraut , "fabriziomello@gmail.com" , "pgsql-hackers@lists.postgresql.org" , Bruce Momjian Subject: Re: pg_upgrade: Pass -j down to vacuumdb In-reply-to: <03845f77-49e7-4569-7062-8ee1fb460ec2@redhat.com> References: <201902010958.cf2cbi3d2ule@alvherre.pgsql> <03845f77-49e7-4569-7062-8ee1fb460ec2@redhat.com> Comments: In-reply-to Jesper Pedersen message dated "Tue, 12 Mar 2019 16:24:01 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <30469.1553551070.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 25 Mar 2019 17:57:50 -0400 Message-ID: <30470.1553551070@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Jesper Pedersen writes: > [ v9_0001-Highlight-that-the-jobs-option-isn-t-passed-down-to-.patch ] Now that I've looked at this, it seems like it's fairly confused about what the proposed VACUUMDB_OPTS variable would actually do for you. If you're going to run vacuumdb directly, it hardly seems like you'd bother with setting such a variable; you'd just enter the options you want directly on the command line. Conversely, if what you plan to do is set VACUUMDB_OPTS and then run this script, the fact that --analyze-in-stages is hard-wired into the script's invocation doesn't seem right either: you probably don't want that if your goal is to get done as fast as possible. In short, I'm not convinced that most of this patch is an improvement on the status quo. I think we'd be best off to just take the idea of explicitly mentioning adding --jobs to a manual run, ie roughly fprintf(script, "echo %sthis script and run:%s\n", ECHO_QUOTE, ECHO_QUOTE); fprintf(script, "echo %s \"%s/vacuumdb\" %s--all %s%s\n", ECHO_QUOTE, new_cluster.bindir, user_specification.data, /* Did we copy the free space files? */ (GET_MAJOR_VERSION(old_cluster.major_version) >=3D 804) ? "--analyze-only" : "--analyze", ECHO_QUOTE); + fprintf(script, "echo %sYou may wish to add --jobs=3DN for parallel anal= yzing.%s\n", + ECHO_QUOTE, ECHO_QUOTE); fprintf(script, "echo%s\n\n", ECHO_BLANK); fprintf(script, "\"%s/vacuumdb\" %s--all --analyze-in-stages\n", regards, tom lane