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.96) (envelope-from ) id 1x4hH1-007KEJ-2m for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Sep 2026 16:05:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x4hGz-007WRP-24 for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Sep 2026 16:05:13 +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.96) (envelope-from ) id 1x4hGy-007WRH-2P for pgsql-hackers@lists.postgresql.org; Thu, 10 Sep 2026 16:05:13 +0000 Received: from flow-a3-smtp.messagingengine.com ([103.168.172.138]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x4hGw-00000004z58-1ZpY for pgsql-hackers@postgresql.org; Thu, 10 Sep 2026 16:05:11 +0000 Received: from phl-compute-07.internal (phl-compute-07.internal [10.202.2.47]) by mailflow.phl.internal (Postfix) with ESMTP id 27B68138019E; Thu, 10 Sep 2026 12:05:09 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-07.internal (MEProxy); Thu, 10 Sep 2026 12:05:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm2; t=1789056309; x= 1789063509; bh=jWCTlKiXCR/PcUywyk8o7abxtWBh0Lt9PZqmhrOXwBs=; b=Q 4KxrE2jrYwWvruLss0vNYl6tHanLta0Hxe/o+PVyUmjqIZExVLMVu4b+ZaFlgOsh I1X7AUCWFhUgo3bvy+ZSzdp0jf8FnjhfBrQn5GjMaBhCW6GqjvriYKrbJYc2Vmqo 10UDsDBK3MTwUleYU8FMc2lvxADf3s4HHAShNskRxKxC3ykd18Sm5kxrn9vbsmBK DA2mMA6ReGHgoYDacZlxwT4FLWT1zWZ+Ookt0wBXoB3M9EDLSQax2aCMrCO2Pdsy PiQWLcmLUKTr1HzVc9MIXlS/NiyASsr3iHwdQRh9eeeavaQoF+vXNT13KvSm2ziF xY4vtc30GDp4RBbXbPhBg== 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=1789056309; x=1789063509; bh=j WCTlKiXCR/PcUywyk8o7abxtWBh0Lt9PZqmhrOXwBs=; b=Cz6iaScKXO/ntwwa0 t38a9b9i26ztu57jkSLgmv3xY4yAXS8DakfYfbBObtDxzDlO33b3qU7SiQz6U4FP ZdFXxHMBdLPYlEODaz+/dsI5AxmJ1/5kp+SMkqq6tXw4WsMANG/RScLRxPDZq3RF 1Y4vuBCUxnpqQGqCG6TgXxEliZI7DdJ/FMSGVTHQGy902JycNLEaGpAnw8VU5uB6 MrKSfXmGWnsROxKkC1nRVudvNMaiENB7qOZnuTmtXCit6A0lUpgQzsGxR1+Qkei3 izei/CYCaWIF3uIUGGYESgFf9hYIAxnn9PQ8q5k+0C8WHWbGCo10XOOu79wtvJ0B xOk7w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGnvtn+OqgqQTmROtJvAbZLny1959vGQLAJp8RHtzymVVU9USGfUCXfwwHenKS4BB 9ML3TDrAj6asjBkVRnD36Sa9nTiOt9/Ut9AXQYLssFRuWl3nNi0CUNa6R3COh91AzMH3u4 kuKipAVuOrusctjrtEgT+mDEpPdFPyuH6gm7xHJcCuqwQXiHpYjcg1QEyb93ZY3dMqu83i lH4Npv9ioKiHu5mzNQUyujnm/MbmEz6nVvg+TFkNLnFZu4Kh7Txk34fbj2nedaQbN9hvgn IJGckKGC0oMHwqgdsH0p3S7jqu4yZdbNKLFD4WtuOpD8xYm6swPKJaRdL5BbLoy+5xTcF8 OQt4BPH6vASujsrUhrKaApHQ9xDSOhrWX0H5s7eFdImrJDoYS9fXHOfw2qonIX+Jf7efxR MKhLtrQi4vpxyDBR4eDvCUtKHxRIZ3l0n1g2xN7/Qm5CPTlehhS1KbdmFqQZLL5gMqN5PY 2HIKocSrMy7jbi8oBy2NIAD6QvrfrjFAC0ccq3+TmP+fz7eP+cRWWawSr/XrK1G2CcCzJN kEFlalGqaMB2hX+jWbSN0RW4Fysc+OlJvWRwtonx8UCFhVw/PMhmRI4lj8ck2/eIUhABKj hFbdenizHXcdPxe20jPNLIbn68mvFTWQGUcUk1cB5CvlG4rDU1gsS+T9QTqQ X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 10 Sep 2026 12:05:08 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1789056305; bh=GFhYZQcyv9ypcmXAU4ddvKE3B8ctItTY7vFP6/9nTz4=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=N9ZqIETec2iV+H6rILq/bQh3xwQeRCqNzW5IiuJCvCAwt2t+2XxtQe0xFmdWfymxe PJr8oNEN53RmqZh+0Xp6D2I5vMZLKMcrKtXHvfPRo7jTUIuZoGpx7kumxXHfVHwnxt Sn01LLGcWyHIkO/XkDKgIE1ILs0rAAyeHdsa/KMTrNwpHc3VQzp0VICnt18C7U3NUZ SLO921Va7OOwSJhCkL3wR6mkeV9p30vndtFKyrzW6iWHCObzfru77zHIAHV4Nsfgo3 ADsiDNQyhxLQ+TyuG7eafqwVOKC1dEtj+Om6560dQ52RLv3gkdI+M3lkQn4quklW0F KDU9phnifO+rw== Received: by ida.kurilemu.internal (Postfix, from userid 1000) id 8742CB00039; Thu, 10 Sep 2026 18:05:05 +0200 (CEST) Date: Thu, 10 Sep 2026 18:05:05 +0200 From: Alvaro Herrera To: Chao Li Cc: Antonin Houska , Kirill Reshke , PostgreSQL-development Subject: Re: Fix REPACK with WITHOUT OVERLAPS replica identity indexes Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <69CA7636-0359-42B6-B971-16A036698187@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2026-May-13, Chao Li wrote: > After some investigation, I think I see the mismatch: > > * get_relation_info(): non-ordered GiST cannot provide sort order. > That is expected. > * copy_table_data() only uses plan_cluster_use_sort() for btree. For > any other clusterable index, it sets use_sort = false and does a raw > index scan. > * The docs say REPACK can re-sort using index scan “if the index is a > b-tree” or seqscan+sort, which does not describe what the code > actually does for GiST. > > I am not sure whether we should change the behavior in PG19. Alvaro > may have a better idea about that. But I agree that we can at least > clarify the code comment and documentation. The attached patch > attempts to do that. I am sure that we should not change the behavior for 19. We could change it in 20, perhaps. But I think the really gross problem is that somehow I made the documentation say exactly the opposite of truth, in the rework for commit ac58465e0618. I fixed that just now with by pushing 07aef52eba3c, which includes your (Chao's) proposed change; but also, while reading and rereading the existing docs and your patch, it struck me that the preexisting text was not super nice either: there was one introductory text, then some technical details, then some more discussion, then more technicalities. That was weird and probably just historical accident. I reordered the text and made some other wording changes. I *think* result is reasonable, or at least it contains no egregious errors; but maybe it could be further improved, if anybody is interested. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "El Maquinismo fue proscrito so pena de cosquilleo hasta la muerte" (Ijon Tichy en Viajes, Stanislaw Lem)