Re: [PATCH] kNN for btree
Anton A. Melnikov <a.melnikov@postgrespro.ru>
From: "Anton A. Melnikov" <a.melnikov@postgrespro.ru>
To: "Andrey M. Borodin" <x4mmm@yandex-team.ru>
Cc: Peter Geoghegan <pg@bowt.ie>, Alexander Korotkov <aekorotkov@gmail.com>,
'Alvaro Herrera' <alvherre@alvh.no-ip.org>,
Nikita Glukhov <n.gluhov@postgrespro.ru>,
Thomas Munro <thomas.munro@gmail.com>, David Steele <david@pgmasters.net>,
Anastasia Lubennikova <lubennikovaav@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-07-31T04:46:18Z
Lists: pgsql-hackers
Attachments
- v19_0001-Introduce-IndexAmRoutine.ammorderbyopfirstcol.patch (text/x-patch) patch v19-0001
- v19_0002-Allow-ordering-by-operator-in-ordered-indexes.patch (text/x-patch) patch v19-0002
- v19_0003-Extract-BTScanState-from-BTScanOpaqueData.patch (text/x-patch) patch v19-0003
- v19_0004-Move-scalar-distance-operators-from-btree_gist-to-co.patch (text/x-patch) patch v19-0004
- v19_0005-Add-knn-support-to-btree-indexes.patch (text/x-patch) patch v19-0005
Hi! Rebased existing patch on current master to have an actual working version. There is an inconsistency with commit 5bf748b86. Reproduction: CREATE TABLE test (a int4); INSERT INTO test VALUES (2), (3); CREATE INDEX test_idx ON test USING btree(a); SET enable_seqscan = OFF; SELECT * FROM test WHERE a IN (2, 3) ORDER BY a <-> 5; Actual result: postgres=# SELECT * FROM test WHERE a IN (2, 3) ORDER BY a <-> 5; a --- 3 (1 row) Correct expected result: postgres=# SELECT * FROM test WHERE a IN (2, 3) ORDER BY a <-> 5; a --- 3 2 (2 rows) Reported an issue in the thread corresponding to commit 5bf748b86. With the best regards, -- Anton A. Melnikov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company
Commits
-
Enhance nbtree ScalarArrayOp execution.
- 5bf748b86bc6 17.0 cited
-
Fix handling of non-key columns get_index_column_opclass()
- c6ce5f71b082 12.0 landed
- 7e0416039046 13.0 landed
-
Add SQL-accessible functions for inspecting index AM properties.
- ed0097e4f9e6 9.6.0 cited