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 1h3nwd-0001Mg-HG for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Mar 2019 20:24:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h3nwc-0007Tp-1Q for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Mar 2019 20:24:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3nwb-0007QC-O5 for pgsql-hackers@lists.postgresql.org; Tue, 12 Mar 2019 20:24:13 +0000 Received: from mail-qt1-f193.google.com ([209.85.160.193]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3nwU-0000eC-Aj for pgsql-hackers@lists.postgresql.org; Tue, 12 Mar 2019 20:24:13 +0000 Received: by mail-qt1-f193.google.com with SMTP id v20so4125644qtv.12 for ; Tue, 12 Mar 2019 13:24:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:cc:references:from :organization:message-id:date:user-agent:mime-version:in-reply-to :content-language; bh=nheminAVxN9E/fggDVuAQGX+dtyOk1LFzsAxqtJw7/k=; b=VKXrZoKBdGoJCaJUxeB/HBm/od3FIce0kXCDdavOJEh1R0KGn1PcBRYZ33MJHiWa1m x4qypyTrikK2vXidxKEPWCsZaZXPI7v2vh7K3K2etL+SnjOF3kGDelQvahqXPKWBWaDD tlwVyIA4uLGe4vVqSPOeybJ/VRv+ELu9c/WlxjDsITLXDs8LlacAHkT7UZvpk2PSGY+0 5n2/Inf7uuZjx78ZVZ5EPYfDFJB1L5JY3L7YjN7JIOSV18rZtECzKJjlI0Lk7ABBwc2e 9XWr1vBnZdDUv0D0wpMtQ9bxep/LuxYyESJxGXccUKhkLoDEbiaQ+oOfjMbGnyv5Ub20 N0Pg== X-Gm-Message-State: APjAAAWQcSd21MRXLFCUt55nM4mKotSnwfqqLDdOJcyR2EE7cliBb9LF lg1HcFfFzmYkhWL0o7+1aSJJBA== X-Google-Smtp-Source: APXvYqxaqjSeNv4HRzLl0ZpNf90GAXNlSECBX1S51eaCwQex9uBeO1+JEusVEVUjmeqZ1T0rsdOZJQ== X-Received: by 2002:ac8:2708:: with SMTP id g8mr32134822qtg.110.1552422244208; Tue, 12 Mar 2019 13:24:04 -0700 (PDT) Received: from localhost.localdomain (c-24-61-8-151.hsd1.ma.comcast.net. [24.61.8.151]) by smtp.gmail.com with ESMTPSA id u64sm4917901qki.24.2019.03.12.13.24.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Mar 2019 13:24:03 -0700 (PDT) Reply-To: jesper.pedersen@redhat.com Subject: Re: pg_upgrade: Pass -j down to vacuumdb To: Robert Haas , "Jamison, Kirk" Cc: Alvaro Herrera , Michael Paquier , Peter Eisentraut , "fabriziomello@gmail.com" , Tom Lane , "pgsql-hackers@lists.postgresql.org" , Bruce Momjian References: <201902010958.cf2cbi3d2ule@alvherre.pgsql> From: Jesper Pedersen Organization: Red Hat Message-ID: <03845f77-49e7-4569-7062-8ee1fb460ec2@redhat.com> Date: Tue, 12 Mar 2019 16:24:01 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------189C3AB6B3033C7286AAFE0A" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------189C3AB6B3033C7286AAFE0A Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi, Thanks Kirk ! On 3/12/19 2:20 PM, Robert Haas wrote: > The words 'by default' should be removed here, because there is also > no non-default way to get that behavior, either. > Here is v9 based on Kirk's and your input. Best regards, Jesper --------------189C3AB6B3033C7286AAFE0A Content-Type: text/x-patch; name="v9_0001-Highlight-that-the-jobs-option-isn-t-passed-down-to-.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename*0="v9_0001-Highlight-that-the-jobs-option-isn-t-passed-down-to-"; filename*1=".patch" From 5b879f79300412638705e32aa3ed51aff3cbe75c Mon Sep 17 00:00:00 2001 From: jesperpedersen Date: Tue, 12 Mar 2019 16:02:27 -0400 Subject: [PATCH] Highlight that the --jobs option isn't passed down to vacuumdb. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Author: Jesper Pedersen and Kirk Jamison Reviewed-by: Peter Eisentraut, Jerry Sievers, Michael Paquier, Tom Lane, Fabrízio de Royes Mello, Álvaro Herrera and Robert Haas Discussion: https://www.postgresql.org/message-id/flat/11b6b108-6ac0-79a6-785a-f13dfe60ab92@redhat.com --- doc/src/sgml/ref/pgupgrade.sgml | 6 +++++- src/bin/pg_upgrade/check.c | 23 +++++++++++++++++++---- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/doc/src/sgml/ref/pgupgrade.sgml b/doc/src/sgml/ref/pgupgrade.sgml index 7e1afaf0a5..5f2a94918d 100644 --- a/doc/src/sgml/ref/pgupgrade.sgml +++ b/doc/src/sgml/ref/pgupgrade.sgml @@ -395,7 +395,11 @@ NET STOP postgresql-&majorversion; in parallel; a good place to start is the maximum of the number of CPU cores and tablespaces. This option can dramatically reduce the time to upgrade a multi-database server running on a multiprocessor - machine. + machine. Note that this option isn't passed to the + vacuumdb application. + The system environment variable VACUUMDB_OPTS can be + used to pass extra options to the vacuumdb + application during the script execution. diff --git a/src/bin/pg_upgrade/check.c b/src/bin/pg_upgrade/check.c index fc5aa7010f..e4356f011c 100644 --- a/src/bin/pg_upgrade/check.c +++ b/src/bin/pg_upgrade/check.c @@ -493,17 +493,32 @@ create_script_for_cluster_analyze(char **analyze_script_file_name) fprintf(script, "echo %sIf you would like default statistics as quickly as possible, cancel%s\n", ECHO_QUOTE, ECHO_QUOTE); - fprintf(script, "echo %sthis script and run:%s\n", + fprintf(script, "echo %sthis script. You may add optional vacuumdb options (e.g. --jobs)%s\n", ECHO_QUOTE, ECHO_QUOTE); - fprintf(script, "echo %s \"%s/vacuumdb\" %s--all %s%s\n", ECHO_QUOTE, + fprintf(script, "echo %sby editing $VACUUMDB_OPTS, then run the command below.%s\n", + ECHO_QUOTE, ECHO_QUOTE); +#ifndef WIN32 + fprintf(script, "echo %s \"%s/vacuumdb\" %s $VACUUMDB_OPTS --all %s%s\n", ECHO_QUOTE, new_cluster.bindir, user_specification.data, - /* Did we copy the free space files? */ + /* Did we copy the free space files? */ (GET_MAJOR_VERSION(old_cluster.major_version) >= 804) ? "--analyze-only" : "--analyze", ECHO_QUOTE); +#else + fprintf(script, "echo %s \"%s\\vacuumdb.exe\" %s %%VACUUMDB_OPTS%% --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) >= 804) ? + "--analyze-only" : "--analyze", ECHO_QUOTE); +#endif fprintf(script, "echo%s\n\n", ECHO_BLANK); - fprintf(script, "\"%s/vacuumdb\" %s--all --analyze-in-stages\n", +#ifndef WIN32 + fprintf(script, "\"%s/vacuumdb\" %s $VACUUMDB_OPTS --all --analyze-in-stages\n", new_cluster.bindir, user_specification.data); +#else + fprintf(script, "\"%s\\vacuumdb.exe\" %s %%VACUUMDB_OPTS%% --all --analyze-in-stages\n", + new_cluster.bindir, user_specification.data); +#endif /* Did we copy the free space files? */ if (GET_MAJOR_VERSION(old_cluster.major_version) < 804) fprintf(script, "\"%s/vacuumdb\" %s--all\n", new_cluster.bindir, -- 2.17.2 --------------189C3AB6B3033C7286AAFE0A--