On Tue, Jul 2, 2019 at 9:19 PM Nikita Glukhov <n.glu...@postgrespro.ru> wrote: > We could use commuted "const <-> var" operators for kNN searches, but the > current implementation requires the existence of "var <-> const" operators, > and > order-by-op clauses are rebuilt using them (see match_clause_to_ordering_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. Otherwise, it may arise again once we want to add some more kNN support to opclasses or something. On the other hand, are we already going to limit oid consumption? ------ Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company