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 1gf89v-0004I8-6t for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Jan 2019 18:55:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gf89t-0007TM-Pd for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Jan 2019 18:55:57 +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 1gf89t-0007TF-6O for pgsql-hackers@lists.postgresql.org; Thu, 03 Jan 2019 18:55:57 +0000 Received: from resqmta-ch2-11v.sys.comcast.net ([2001:558:fe21:29:69:252:207:43]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gf89p-00030c-Tc for pgsql-hackers@lists.postgresql.org; Thu, 03 Jan 2019 18:55:56 +0000 Received: from resomta-ch2-15v.sys.comcast.net ([69.252.207.111]) by resqmta-ch2-11v.sys.comcast.net with ESMTP id f7MBgUoqayXu9f89jgGasx; Thu, 03 Jan 2019 18:55:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20161114; t=1546541747; bh=je0RfVdRR24XmYQqvzMisx2KvkM7wPOyJV0L6wat03E=; h=Received:Received:Received:From:To:Subject:Date:Message-ID: MIME-Version:Content-Type; b=oK2B6g1tzoDdLcF3Iz4fukR8VrEPXtvyTrf3sYahAFki05rzB1vYY7OgdyOzbIv78 H/3erVByfm5dXaed/NDQPLr1/afGWv+6LDviiOBhQLj+MT8PpmULHkxDuOEpobNJ0t yjn+K26v0SMAxA7OefUkcyJziYX1ihfWVS/BrxBwFIPGDaOv1X+RYxXPqHfS+C/63H vIRkMoRVLZ5fMpKi0BR8a+2O0JOzdu7jTL/+mP+o2B1biSmlUMzKJhEWNb7Ef9rYud bClAvKBu3Sfz4oSOmxH0JBtPrESivyn88/KPLDqYzr5GeTTmODKbRW48fRpqerc6hq MP+9R3O8wZITA== Received: from jsievers.comcast.net ([12.187.116.132]) by resomta-ch2-15v.sys.comcast.net with ESMTPA id f89WgFj3KNtmzf89Wgcz4U; Thu, 03 Jan 2019 18:55:45 +0000 X-Xfinity-VAAS: gggruggvucftvghtrhhoucdtuddrgedtledrudelgdeitdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucevohhmtggrshhtqdftvghsihdpqfgfvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpeflvghrrhihucfuihgvvhgvrhhsuceoghhsihgvvhgvrhhsudelsegtohhmtggrshhtrdhnvghtqeenucfkphepuddvrddukeejrdduudeirddufedvnecurfgrrhgrmhephhgvlhhopehjshhivghvvghrshdrtghomhgtrghsthdrnhgvthdpihhnvghtpeduvddrudekjedrudduiedrudefvddpmhgrihhlfhhrohhmpehgshhivghvvghrshduleestghomhgtrghsthdrnhgvthdprhgtphhtthhopehpvghtvghrrdgvihhsvghnthhrrghuthesvdhnughquhgrughrrghnthdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopegsrhhutggvsehmohhmjhhirghnrdhushdprhgtphhtthhopehjvghsphgvrhdrphgvuggvrhhsvghnsehrvgguhhgrthdrtghomhenucevlhhushhtvghrufhiiigvpedt X-Xfinity-VMeta: sc=0;st=legit Received: from jsievers.enova.com (localhost [127.0.0.1]) by jsievers.comcast.net (Postfix) with ESMTP id 197BD260056; Thu, 3 Jan 2019 12:55:34 -0600 (CST) From: Jerry Sievers To: Peter Eisentraut Cc: jesper.pedersen@redhat.com, "pgsql-hackers\@lists.postgresql.org" , Bruce Momjian Subject: Re: pg_upgrade: Pass -j down to vacuumdb References: <11b6b108-6ac0-79a6-785a-f13dfe60ab92@redhat.com> <2dc5eaeb-e60d-2a16-696e-7b4d3d3548cb@redhat.com> <59f9323a-fee8-88f6-16ab-2319149b00be@2ndquadrant.com> Date: Thu, 03 Jan 2019 12:55:34 -0600 In-Reply-To: <59f9323a-fee8-88f6-16ab-2319149b00be@2ndquadrant.com> (Peter Eisentraut's message of "Thu, 3 Jan 2019 13:03:21 +0100") Message-ID: <87ftu9r2op.fsf@jsievers.enova.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Peter Eisentraut writes: > On 02/01/2019 20:47, Jesper Pedersen wrote: > >> Well, that really depends. The user passed -j to pg_upgrade in order for >> the upgrade to happen faster, so maybe they would expect, as I would, >> that the ANALYZE phase would happen in parallel too. > > pg_upgrade -j reduces the *downtime* caused by pg_upgrade during the > upgrade process. Also, during said downtime, nothing else is happening, > so you can use all the resources of the machine. > > Once the system is back up, you don't necessarily want to use all the > resources. The analyze script is specifically written to run while > production traffic is active. If you just want to run the analyze as > fast as possible, you can just run vacuumdb -j directly, without using > the script. Peter, I'm skeptical here. I might permit a connection to a just pg_upgraded DB prior to any analyze being known finished only for the most trivial case. At my site however, *trivial* systems are a small minority. In fact, our automated upgrade workflow uses our home-built parallel analyzer which predates vacuumdb -j. Apps are not allowed into the DB until a fast 1st pass has been done. We run it in 2 phases... $all preceeding upgrade steps w/system locked out analyze-lite (reduced stats target) open DB for application traffic analyze-full Of course we are increasing downtime by disallowing app traffic till finish of analyze-lite however the assumption is that many queries would be too slow to attempt without full analyzer coverage, albiet at a reduced stats target. IMO this is certainly a case of no 1-size-fits-all solution so perhaps a --analyze-jobs option :-) FWIW Thanks > Moreover, it's not clear that pg_upgrade and vacuumdb are bound the same > way, so it's not a given that the same -j number should be used. > > Perhaps more documentation would be useful here. -- Jerry Sievers Postgres DBA/Development Consulting e: postgres.consulting@comcast.net