Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hiODk-00044a-Qi for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Jul 2019 19:13:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hiODj-0006YQ-LQ for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Jul 2019 19:13:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hiODj-0006YJ-D0 for pgsql-hackers@lists.postgresql.org; Tue, 02 Jul 2019 19:13:39 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hiODh-0004HP-7X for pgsql-hackers@postgresql.org; Tue, 02 Jul 2019 19:13:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x62JDU8t004683; Tue, 2 Jul 2019 15:13:30 -0400 From: Tom Lane To: Alexander Korotkov cc: Nikita Glukhov , Fabien COELHO , PostgreSQL Hackers Subject: Re: Add missing operator <->(box, point) In-reply-to: References: <6935.1562040096@sss.pgh.pa.us> <2fe442bd-4e0c-56ba-eb62-f1b51f6b17f3@postgrespro.ru> Comments: In-reply-to Alexander Korotkov message dated "Tue, 02 Jul 2019 21:55:40 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4681.1562094810.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 02 Jul 2019 15:13:30 -0400 Message-ID: <4682.1562094810@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alexander Korotkov writes: > On Tue, Jul 2, 2019 at 9:19 PM Nikita Glukhov = wrote: >> We could use commuted "const <-> var" operators for kNN searches, but t= he >> current implementation requires the existence of "var <-> const" operat= ors, and >> order-by-op clauses are rebuilt using them (see match_clause_to_orderin= g_op() >> at /src/backend/optimizer/path/indxpath.c). > But probably it's still worth to just add commutator for every <-> > operator and close this question. Yeah, I was just thinking that it was weird not to have the commutator operators, independently of indexing considerations. Seems like a usability thing. regards, tom lane