pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alexander Nestorov <alexandernst@gmail.com>
Cc: Maxime Schoemans <maxime.schoemans@enterprisedb.com>
Cc: Andrey Borodin <x4mmm@yandex-team.ru>
Cc: pgsql-hackers mailing list <pgsql-hackers@postgresql.org>
Subject: Re: [PATCH] btree_gist: add cross-type integer operator support for GiST
Date: Fri, 25 Sep 2026 14:54:45 -0400
Message-ID: <2011408.1790362485@sss.pgh.pa.us> (raw)
In-Reply-To: <a95e833c-eba2-4a19-8692-06736df3ba5d@Spark>
References: <aac10ffa-a0ca-4c49-846b-3655cbc6b37e@Spark>
	<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>
	<E3255EC9-4666-47FD-A22B-FDD962307FD8@enterprisedb.com>
	<ac05a661-53a5-478a-9907-f56a960dab51@Spark>
	<68E31455-03AB-4EAA-A87C-95D95711CC70@enterprisedb.com>
	<aea734bb-fd8d-4642-8972-2a57e5643a03@Spark>
	<5855E6CD-2F56-445A-B332-8AB0DFB496F4@enterprisedb.com>
	<ee1d33e0-ff3a-4faa-bfa0-f3451e0b34ae@Spark>
	<9CD290B1-C382-46CB-9ADE-CE6B039EBB25@yandex-team.ru>
	<52379f05-166d-4f51-9fc1-27765cd30e9f@Spark>
	<8569761e-e46e-4d1e-943b-696da2e597cd@Spark>
	<A5D3186A-5AED-462D-812B-1D6137F93A64@enterprisedb.com>
	<568E6CF6-1635-40E9-8EC1-17B93BAB9C86@yandex-team.ru>
	<a95e833c-eba2-4a19-8692-06736df3ba5d@Spark>

Alexander Nestorov <alexandernst@gmail.com> 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






view thread (19+ messages)

Message-ID: <2011408.1790362485@sss.pgh.pa.us>
Permalink:  ../2011408.1790362485@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2011408.1790362485@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, alexandernst@gmail.com, maxime.schoemans@enterprisedb.com, x4mmm@yandex-team.ru
  Subject: Re: [PATCH] btree_gist: add cross-type integer operator support for GiST
  In-Reply-To: <2011408.1790362485@sss.pgh.pa.us>
  References: <aac10ffa-a0ca-4c49-846b-3655cbc6b37e@Spark> <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> <E3255EC9-4666-47FD-A22B-FDD962307FD8@enterprisedb.com> <ac05a661-53a5-478a-9907-f56a960dab51@Spark> <68E31455-03AB-4EAA-A87C-95D95711CC70@enterprisedb.com> <aea734bb-fd8d-4642-8972-2a57e5643a03@Spark> <5855E6CD-2F56-445A-B332-8AB0DFB496F4@enterprisedb.com> <ee1d33e0-ff3a-4faa-bfa0-f3451e0b34ae@Spark> <9CD290B1-C382-46CB-9ADE-CE6B039EBB25@yandex-team.ru> <52379f05-166d-4f51-9fc1-27765cd30e9f@Spark> <8569761e-e46e-4d1e-943b-696da2e597cd@Spark> <A5D3186A-5AED-462D-812B-1D6137F93A64@enterprisedb.com> <568E6CF6-1635-40E9-8EC1-17B93BAB9C86@yandex-team.ru> <a95e833c-eba2-4a19-8692-06736df3ba5d@Spark> <2011408.1790362485@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox