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 1trb3s-00611W-6G for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Mar 2025 11:12:44 +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 1trb3q-009T04-PQ for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Mar 2025 11:12:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1trb3q-009Szt-DM for pgsql-hackers@lists.postgresql.org; Mon, 10 Mar 2025 11:12:42 +0000 Received: from fhigh-a5-smtp.messagingengine.com ([103.168.172.156]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1trb3n-0020wY-2d for pgsql-hackers@lists.postgresql.org; Mon, 10 Mar 2025 11:12:41 +0000 Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfhigh.phl.internal (Postfix) with ESMTP id A00861140113; Mon, 10 Mar 2025 07:12:38 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-08.internal (MEProxy); Mon, 10 Mar 2025 07:12:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1741605158; x=1741691558; bh=M s4y1FuA2mTW++rmnW3LyGjHXmPudBxYZ4+dyUxdW9U=; b=FZKSoR68zp9Vj1kyN B3aa9kOQqpbR6lGJrWCtw7WXlL59RFThgv+bMr/MqplRdAC4Ft/5pqGuOr3J2kmd girc/aGVq+doxE1uTde0Kj9QkuNuFzQCAKATWh57JnnEVMfYpNso5KAP49ioSdq1 0bYvcmMjxo1NB/ijIwx+r5KNbtKStNhCDsNz1IWLfSGo8VLMfwck3AO5Xi94JAjJ s8NmO0wk+kGaoCA0N5VGnUJWt4Uto3npdnbw8XBWFxnlzR3Qffy28WWUAcjRBmh8 igZqpiROCyuB3EOykEFffxzZ7WmKlsvaygtt6zCvWh8JCWKq66yXJUxUJIRRbxv6 Z5bJQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduudelvddtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepfffhvfevuffkgggtugfgjgesthekredttddt jeenucfhrhhomheplmhlvhgrrhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlh hvhhdrnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhepvdehueffhefgueekueef heehgffhuefgfedukeejveduffegffekgeffffevgeehnecuffhomhgrihhnpegvnhhtvg hrphhrihhsvggusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhep mhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgpdhnsg gprhgtphhtthhopeehpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegrvghkohhr ohhtkhhovhesghhmrghilhdrtghomhdprhgtphhtthhopehorhhlohhvmhhgsehgmhgrih hlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphho shhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepshdruggvrhgvvhihrghnkhhosehpoh hsthhgrhgvshhprhhordhruhdprhgtphhtthhopegrkhhorhhothhkohhvsehpohhsthhg rhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 10 Mar 2025 07:12:37 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1741605153; bh=3TAFI07vFvn00GRdXj3xk5Iy8fdqNCgyIxdSXeFEgoM=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=QwrF5Qpoxv7Vbke72xiOQCj7BLUS936BAxGD+9JIIBjNb1xKhdkGIgFRXn6SU/5n3 tVQ26bElznHtWEyqxEKuC/PY78RvDRlZHh/6Mv4azW5h9+CH9iFz4xvwTCIXc1iaPM 8YIIfSLUUQ3zLB1n944Ui6sc4v7i65mMQAtisG0Q5NB5cxGaEleRJv/cCI5XHezHxX yYtVlGQoxwBVhlsDNkqXUI5ynaRHy/eaFOCdB6sDFZm+AC8quiVS88VccdxSjSZXa+ d/eK7gtdtpVFUfNnGdpBpVO9oIQ6qatm24MRGWKoIpKlhRD/1C5NFdQJJBeTDApo2m nsHDA4DPwWYFA== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 6774391; Mon, 10 Mar 2025 12:12:33 +0100 (CET) Date: Mon, 10 Mar 2025 12:12:33 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Alexander Korotkov Cc: Alexander Korotkov , pgsql-hackers@lists.postgresql.org, Maxim Orlov , Svetlana Derevyanko Subject: Re: pgsql: reindexdb: Add the index-level REINDEX with multiple jobs Message-ID: <202503101112.ozklxnrfw4dr@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025-Mar-09, Alexander Korotkov wrote: > After second thought it's not so hard to fix. The attached patch does > it by putting REINDEX commands related to the same table into a single > SQL statement. Possibly, that could be better than revert given we > need to handle compatibility. What do you think? Oh, this is an egg of Columbus solution, I like it. It seems to work as intended on a quick test. Please add some commentary to run_reindex_command. Maybe another, possibly better way to do this would be to use libpq pipeline mode, sending all the commands for a table in one pipeline instead of a single command. The advantage of this would be that server-side log entries for each command would be separate, and they wouldn't appear clumped together in pg_stat_activity and so on. However, this would require more invasive changes, so it might be better to leave that for a future project -- it's certainly a harder sell for such a change to be backpatched. So I'm +1 on your current patch for 17 and master. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Puedes vivir sólo una vez, pero si lo haces bien, una vez es suficiente"