Re: [PATCH] kNN for btree

Nikita Glukhov <n.gluhov@postgrespro.ru>

From: Nikita Glukhov <n.gluhov@postgrespro.ru>
To: Michael Paquier <michael@paquier.xyz>, Alexander Korotkov <a.korotkov@postgrespro.ru>
Cc: Dmitry Dolgov <9erthalion6@gmail.com>, David Steele <david@pgmasters.net>, Robert Haas <robertmhaas@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2019-02-20T01:18:56Z
Lists: pgsql-hackers

Attachments

On 04.02.2019 8:35, Michael Paquier wrote:
> This patch set needs a rebase because of conflicts caused by the
> recent patches for pluggable storage.

Attached 6th version of the patches rebased onto current master:

  * index_clauses now also passed into ammatchorderby()

  * added support for queries like
    SELECT * FROM tab WHERE col1 = val1 AND col2 = val2 ORDER BY col3 <-> val3

  * (experimental patch #9)
    added support for queries like
    SELECT * FROM tab WHERE col1 IN (v1, v2, v3) ORDER BY col1, col2 <-> val


Patch #9 is experimental.  In order to distinguish order-by-operator and
simple order-by-column clauses (index column can be operator expression)
in orderbyclauses lists I am trying to pass negative column numbers in
orderbyclausecols, but it looks ugly, so I think orderbyclauses passing needs
some refactoring like recent IndexClause refactoring.  Also I doubt that I
correctly implemented match_pathkey_to_indexcol().

--
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company


Commits

  1. Enhance nbtree ScalarArrayOp execution.

  2. Fix handling of non-key columns get_index_column_opclass()

  3. Add SQL-accessible functions for inspecting index AM properties.