Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nwG7E-00029b-VR for pgsql-performance@arkaria.postgresql.org; Wed, 01 Jun 2022 04:37:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nwG7C-0005kE-T3 for pgsql-performance@arkaria.postgresql.org; Wed, 01 Jun 2022 04:37:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nwG7A-0005k5-SH for pgsql-performance@lists.postgresql.org; Wed, 01 Jun 2022 04:37:50 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nwG76-0006Gk-VX for pgsql-performance@postgresql.org; Wed, 01 Jun 2022 04:37:47 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 148ED5C0229; Wed, 1 Jun 2022 00:37:43 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 01 Jun 2022 00:37:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1654058263; x=1654144663; bh=2PE8eW0mdD z20pTlgMjn/YRkG5TtqmyAXFaqo2emRag=; b=kmoknq/nIIPSlR1jNyh4pTl/Yf AXYfQV1Ob2t5z0kEjhw8lEj3ZzRmA2lu/BMCSF6li3Q5i1lUtEu+tIdpvL+ZeSNp X4R92370mESFmFA9VNczU7Qd1hvKN/HQmkM5aOIsAZCKzBRDarSOnM02EY4QPRhT VaZE7LkPwX7VTrKV16rp3fUGX6H00XKFkkOsP8CswP1dscFUKO8524TJPgc8yfCw 0FJZvcKEuzk272iGjT4h9Yv3BlGVIuM7PqLTVuU2gDRu1sDnT0fiUisDHNYNpy58 9KZxwiziaYkdr9e7cx62joZCObT+CUTK4yXTYQCh0Ks8sEyw0TRtf7S62FkA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1654058263; x=1654144663; bh=2PE8eW0mdDz20pTlgMjn/YRkG5Tt qmyAXFaqo2emRag=; b=uLObCulhnE2CCIUsSazid3boif5LYImfDG0/IdheFL9W 61szN3oADoArViX7txdOb7v7v/7O0JoT8DH8sX74RmsM+HgBEH++O9PZR2JcILu7 i/IVodNDrV8f7je9sf4uEvceI/K940C2ohRb9WrzIx/7zP5SWyoRbDsVcggFI225 oirPWe5O+6f7x2NN5nqsmWAmVeuhN/bmdB5rcBGHlSigC/rGl4x/gMnZoO23LZWY 0hWjBWeW+YWQ9Wn/GeVwAtPFM7O3TrQSz049hpI/TMcVIoMtS6qq721j/LdJKw74 a9AfIt1cqGS8wtUa2eA7T7cpeBm2Z1SsxWwxDdyuyg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrkeelgdekfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt jeenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeevteejgfejveegudekheeiueei ueeiveeuiedugeehveeugffgudeuleegleeiteenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 1 Jun 2022 00:37:41 -0400 (EDT) Date: Wed, 1 Jun 2022 13:37:37 +0900 From: Michael Paquier To: "David G. Johnston" Cc: Praneel Devisetty , "pgsql-performance@postgresql.org" Subject: Re: REINDEXdb performance degrading gradually PG13.4 Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="CYu2fJ8sNGEJSd9F" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --CYu2fJ8sNGEJSd9F Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 31, 2022 at 08:42:06AM -0700, David G. Johnston wrote: > Building indexes is so IO heavy that the non-IO bottlenecks that exists > likely have minimal impact on the overall times this rebuild everything > will take. That said, I=E2=80=99ve never done anything at this scale bef= ore. I > wouldn=E2=80=99t be too surprised if per-session cache effects are coming= into play > given the number of objects involved and the assumption that each session > used for parallelism is persistent. I=E2=80=99m not sure how the paralle= lism works > for managing the work queue though as it isn=E2=80=99t documented and I h= aven=E2=80=99t > inspected the source code. get_parallel_object_list() in reindexdb.c would give the idea, where the list of tables to rebuild are ordered based on an "ORDER BY c.relpages DESC", then the table queue is processed with its own command, moving on to the next item once we are done with an item in the list. -- Michael --CYu2fJ8sNGEJSd9F Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmKW7REACgkQnvQgOdby QH0u7g//QRH0/+HIypQGAK7OK+17Df3gEBfSbvbw9CObhMmg7FnjS9XI8Z3D8CDt 425NUzCFMzLQyHNh/jyJNor2YFSavt87yoQVjqeU9gKO78kLURf//Hi4k0lamomG EWFsFNhFW7T6TFu00HLldyLfdaWi4sB3i+5idllqsVJL/Tj1GCNieo1cOxkXvH2w pM3otrZE0ehLLT+cVQWVSiUm3GIYERUUVSQsIrIIB1c1+Oi9/+spmoSEx8P84nBl k5cgtNAdS2XIvXoI2rajsFMj9q9AIFpM9zkp3iW5kcmCENpZgVhJZKBzMO60Ah5G X9KsX8fkhMpWewRnySdNoIK3cN43ZMfIxMDzrpq+h4R5VPhMBLN/amgXByHYPjmN Ouk0SG2vO4vdZw22RbDBVgCrBJY8Is6SLW6xUeHB3T+HmPjMvQn2WbL4apX9wvPd DF7GrZ8QAtUreWL0C94SAoEstchcZrniJ+9w6rL0fIWOYdn57u35iiN2HGo7zL4Z cJB8FR6lTImj8tViRVYSo6Gf9w6vYmFbihJ4rP28NTWzvUwVZ8o/wRLWfsNdu9wC 1gkds3tWgs+cevQG3WhqGgX+AAsmz23F0JnRbxI4nbiAb5l9ztID/njy23WMAzW1 kpQKwf9s60reEVVa8di9O5BPCNuqnxTkmRwXsRDMXDLwFGt9kMo= =JOuW -----END PGP SIGNATURE----- --CYu2fJ8sNGEJSd9F--