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 1tqVWk-005yid-B5 for pgsql-committers@arkaria.postgresql.org; Fri, 07 Mar 2025 11:06:02 +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 1tqVWi-00H0dD-O6 for pgsql-committers@arkaria.postgresql.org; Fri, 07 Mar 2025 11:06:00 +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 1tqVWi-00H0d5-31 for pgsql-committers@lists.postgresql.org; Fri, 07 Mar 2025 11:06:00 +0000 Received: from fout-a5-smtp.messagingengine.com ([103.168.172.148]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tqVWe-001UDB-0k for pgsql-committers@lists.postgresql.org; Fri, 07 Mar 2025 11:05:59 +0000 Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfout.phl.internal (Postfix) with ESMTP id DC4741382792; Fri, 7 Mar 2025 06:05:55 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Fri, 07 Mar 2025 06:05:55 -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=1741345555; x=1741431955; bh=t7ZFbmz0MYiuvD1vBxWdjjMaW0tw5m6h 0qm91uTC3gk=; b=nkutSbJTRo++hJKEMhdPotl5vOJuL44yEXLv07asz6RUk4Rb xwnz6OxHCelTjfL35WOPYl3d5fgx9vd3EM+SLD4X4Qvqf7QapeB3CAlRKU4eWhGD LMeIqsPAUUfQSXeFnGZdfeOCxtdLOZTa5fQsKRUxopp+yl5BDgQhsp/Q5zXIR0mU zCZjbI5NeC2yA6JsKj1rAWLhjypppGkwqQiY0TLpZmawVbZJF1JzBDUy63P9Df7L NKMqXUVMVkDPMG5vDp1kGyMlgPulX6bbHG85ttgxAvO41zs7IjFQTeWhJozfenH+ rZ3MykjBL7k5icG6tSW3wKY+ElnFWlC1400SiQ== 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=1741345555; x= 1741431955; bh=t7ZFbmz0MYiuvD1vBxWdjjMaW0tw5m6h0qm91uTC3gk=; b=g HAlZuZik+5Y7+qdW5IfFSzJD7XQf/k/9++LrYNM4HjtNULn0MTaTLVrFefK9k8f/ VIMoXaTgn2+6HTCeTQttSwf+dot7TGinn4ZK0nalA1AdLEI5HkN9zYm6x2lPC7vL doQ4bX2oF85Yke+JeJRrOD1rsPT935khWQzElQy2lBz+zgXQjQzJU90qE2dcbCEF VBDNwKCxxpNzbyUuVDFAx7SXcALgsR6ozrE2fZ1QrSysZmkveO9Vpf164JiN/084 kORO57wb8SW0KaJegaYn9LK8q8cQIXvMxcZRGx1yykTXZzZnrzag7RvVnHfluHDi HSg1m3Nj2JQaBXPY8dbFg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduuddthedtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddt vdejnecuhfhrohhmpefrvghtvghrucfgihhsvghnthhrrghuthcuoehpvghtvghrsegvih hsvghnthhrrghuthdrohhrgheqnecuggftrfgrthhtvghrnhepgfejtdfhkeeftdeugfei leehteeljeeghfeuledthfeutedvffdukeefjefhgeehnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhesvghishgvnhhtrhgruhht rdhorhhgpdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtth hopehtghhlsehsshhsrdhpghhhrdhprgdruhhspdhrtghpthhtohepmhgrrhhkrdguihhl ghgvrhesvghnthgvrhhprhhishgvuggsrdgtohhmpdhrtghpthhtohepphhgshhqlhdqtg homhhmihhtthgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 7 Mar 2025 06:05:54 -0500 (EST) Message-ID: <0f6a8a8a-b42e-433b-89cd-ee121d0919b3@eisentraut.org> Date: Fri, 7 Mar 2025 12:05:53 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pgsql: Generalize hash and ordering support in amapi To: Tom Lane Cc: Mark Dilger , pgsql-committers@lists.postgresql.org References: <2557074.1740673653@sss.pgh.pa.us> <1789fe14-c19d-4025-9201-0eb8faa0840b@eisentraut.org> <165328.1741109742@sss.pgh.pa.us> Content-Language: en-US From: Peter Eisentraut In-Reply-To: <165328.1741109742@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 04.03.25 18:35, Tom Lane wrote: > In any case, my gripe was less about the name of the flag and more > about the lack of a clear specification of what it means. "does AM > support cross-type comparisons" doesn't get the job done. Maybe > we can fit > > /* do operators within an opfamily have consistent equality semantics? */ > bool amconsistentequality; > /* do operators within an opfamily have consistent ordering semantics? */ > bool amconsistentordering; > Also, I'm thinking that equality_ops_are_compatible and > comparison_ops_are_compatible now have a bit of a performance problem. > The original coding was intended to provide a cheap check before > expending the cycles to test op_in_opfamily. This patch has > completely blown that up, since GetIndexAmRoutineByAmId is *more* > expensive than op_in_opfamily. I suggest reversing things so that we > test op_in_opfamily first and only bother to look up the AM details > when we've verified that both operators belong to the same family. I have committed fixes for these issues along the lines you suggested.