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.98.2) (envelope-from ) id 1xAB4O-00000002UkD-43WA for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Sep 2026 18:54:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xAB4O-00000002DNG-0u2I for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Sep 2026 18:54:52 +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.98.2) (envelope-from ) id 1xAB4N-00000002DN8-3tBC for pgsql-hackers@lists.postgresql.org; Fri, 25 Sep 2026 18:54:51 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xAB4L-00000001F1z-23Vk for pgsql-hackers@postgresql.org; Fri, 25 Sep 2026 18:54:51 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 68PIsjqK2011409; Fri, 25 Sep 2026 14:54:45 -0400 From: Tom Lane To: Alexander Nestorov cc: Maxime Schoemans , Andrey Borodin , pgsql-hackers mailing list Subject: Re: [PATCH] btree_gist: add cross-type integer operator support for GiST In-reply-to: References: <36b4f67d-5975-452c-a6b8-b6407f0924ee@Spark> <4B4B0998-7B43-4893-9603-0AF212036690@yandex-team.ru> <18e88767-6c31-402a-887e-37c38b366a6a@Spark> <80ef3b41-1a71-47a4-a320-29e118d7092c@Spark> <68E31455-03AB-4EAA-A87C-95D95711CC70@enterprisedb.com> <5855E6CD-2F56-445A-B332-8AB0DFB496F4@enterprisedb.com> <9CD290B1-C382-46CB-9ADE-CE6B039EBB25@yandex-team.ru> <52379f05-166d-4f51-9fc1-27765cd30e9f@Spark> <8569761e-e46e-4d1e-943b-696da2e597cd@Spark> <568E6CF6-1635-40E9-8EC1-17B93BAB9C86@yandex-team.ru> Comments: In-reply-to Alexander Nestorov message dated "Sun, 13 Sep 2026 19:43:16 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2011407.1790362485.1@sss.pgh.pa.us> Date: Fri, 25 Sep 2026 14:54:45 -0400 Message-ID: <2011408.1790362485@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alexander Nestorov writes: > Attaching v7 patchset. I spent a bit of time looking at v7. I think you have made the wrong choice here: > To let the cross-type path reuse gbt_num_consistent(), all comparison > callbacks are now invoked as f(query, key): query on the left, key on > the right The index AMs are generally built on the principle that an index condition looks like "index_key OP query_value", which is why all the code looks like it does. So I object to changes like case BTLessEqualStrategyNumber: if (is_leaf) - retval = tinfo->f_le(key->lower, query, flinfo); + retval = tinfo->f_ge(query, key->lower, flinfo); else retval = lower_is_below_query(); break; It is confusing and error-prone for the code to be written exactly backwards from the strategy code name. So I think you should undo all those changes and instead change whatever you were trying to avoid changing. I really doubt that that will lead to a messier patch. (Maybe it'd be smart to split 0001 into two steps, one that syncs whatever order-of-parameters problem you see and then one that adds cross-type stuff on top of that.) I'm also confused by all the names involving "q4" and the like. Maybe that conveys something to your mind, but it conveys nothing to mine, and I don't see any comments explaining the naming convention. It'd probably be good to use slightly longer names. Lastly, please avoid making random whitespace changes in places away from your code changes. Those just distract reviewers, and it's not usually apparent that the change is an improvement anyway. Revising line breaks for no very good reason is likewise a drag on reviewers' attention. regards, tom lane