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 1toI8k-008oZG-PO for pgsql-committers@arkaria.postgresql.org; Sat, 01 Mar 2025 08:24:07 +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 1toI8l-0081hC-Mw for pgsql-committers@arkaria.postgresql.org; Sat, 01 Mar 2025 08:24:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1toI8k-0081eg-NQ for pgsql-committers@lists.postgresql.org; Sat, 01 Mar 2025 08:24:06 +0000 Received: from fhigh-a6-smtp.messagingengine.com ([103.168.172.157]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1toI8f-000KAe-0U for pgsql-committers@lists.postgresql.org; Sat, 01 Mar 2025 08:24:04 +0000 Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfhigh.phl.internal (Postfix) with ESMTP id 5B26E1140106; Sat, 1 Mar 2025 03:24:00 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Sat, 01 Mar 2025 03:24:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm3; t=1740817440; x=1740903840; bh=APu/qydcB/eif2dyvbsc2DHzxR7MFAYR cSwxcn4gLzs=; b=UF6YItRdfYxAtIYwqINvfueuj5sGeBGDwiqgbe9oFAyh+bFX Bs8igBgHYxPzZI5Ia8z9V0hsT6eDwGauBfmXR2qq7nXzCre4bHKYOcE3CO8TeE3D 7AlnhAjsQTWWFCgp/4W9xiLZfczFQEZCuhOnwKMBAsgt/6sZ3WOvAgTvLf+YVWL8 BHUr0Ld9LEp6BWfqReMNOw4+xoPQf2K5M6xLoZkaFVEql7mno01hnx2TwSEAjDQY Qr7UKakEzQJkUEQU42ur2k3JLFqq91Hwp6aUlNesSrVrofl/lFJ4oDyZo4Z2TJx1 bmN+Q978sbZQWKooyXUkp2cHGC/UrmaMIQ5R0g== 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 :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1740817440; x= 1740903840; bh=APu/qydcB/eif2dyvbsc2DHzxR7MFAYRcSwxcn4gLzs=; b=5 WUFKubCgOFNBvU93DFYr8IpVsGzdyfeVT4BlThombSEcn4e9Nw0fQ3O5U+MXnlDV UvzqEpiMloUNwawZCKP2dia7fEO7/GzKHQGqP+GQyyrkurudyopy4TlRdfJWWZSZ aMfcCQ1Y71RoZni2vrysjGBFtBrrX3glUHdXqw05QCFQZBeUots7++ibRNJeKLL/ SwaVM+4mLpzZSu2EzAw5rzG21PnPZT0q5uCSdlmZqdoZ7NFUV6LMAX6rXmMglNzf 82ykL+xgeHj4hpDs+sjG3vgv9WA2cufKR/uejevFo1pa6VRuZic2iineuNI29ecy gfZvaMiKABgcseGek3biQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdelvdekudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthekredttddv jeenucfhrhhomheprfgvthgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhesvghish gvnhhtrhgruhhtrdhorhhgqeenucggtffrrghtthgvrhhnpeejhfevhedttefgfffhhfef fefggffhffelgfeiueeukeehvdehvdefheffvdefueenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrsegvihhsvghnthhrrghuthdr ohhrghdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoh epmhgrrhhkrdguihhlghgvrhesvghnthgvrhhprhhishgvuggsrdgtohhmpdhrtghpthht ohepthhglhesshhsshdrphhghhdrphgrrdhushdprhgtphhtthhopehpghhsqhhlqdgtoh hmmhhithhtvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 1 Mar 2025 03:23:59 -0500 (EST) Message-ID: <5cc4192a-7c28-4a69-a879-477b5ece600c@eisentraut.org> Date: Sat, 1 Mar 2025 09:23:57 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pgsql: Generalize hash and ordering support in amapi To: Mark Dilger , Tom Lane Cc: pgsql-committers@lists.postgresql.org References: <2557074.1740673653@sss.pgh.pa.us> Content-Language: en-US From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 27.02.25 23:17, Mark Dilger wrote: > > On Thu, Feb 27, 2025 at 8:27 AM Tom Lane > wrote: > > Peter Eisentraut > writes: > > Generalize hash and ordering support in amapi > > Stop comparing access method OID values against HASH_AM_OID and > > BTREE_AM_OID, and instead check the IndexAmRoutine for an index > to see > > if it advertises its ability to perform the necessary ordering, > > hashing, or cross-type comparing functionality.  A field amcanorder > > already existed, this uses it more widely.  Fields amcanhash and > > amcancrosscompare are added for the other purposes. > > AFAICS, this patch sets amcancrosscompare true only for btree, > which means this change to equality_ops_are_compatible is surely wrong: > > -       /* must be btree or hash */ > -       if (op_form->amopmethod == BTREE_AM_OID || > -           op_form->amopmethod == HASH_AM_OID) > +       if (amroutine->amcancrosscompare) > > > It seems you are right.  hashhandler()'s amroutine should have this > true, also. I have fixed that. I will come back to the rest of the discussion in a bit.