mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-01 02:02:10 +08:00
Started indexing
This commit is contained in:
12
test/sql/hnsw_hamming.sql
Normal file
12
test/sql/hnsw_hamming.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
SET enable_seqscan = off;
|
||||
|
||||
CREATE TABLE t (val bit(3));
|
||||
INSERT INTO t (val) VALUES (B'000'), (B'100'), (B'111'), (NULL);
|
||||
CREATE INDEX ON t USING hnsw (val bit_hamming_ops);
|
||||
|
||||
INSERT INTO t (val) VALUES ('110');
|
||||
|
||||
SELECT * FROM t ORDER BY val <~> '111';
|
||||
SELECT COUNT(*) FROM (SELECT * FROM t ORDER BY val <~> (SELECT NULL::bit)) t2;
|
||||
|
||||
DROP TABLE t;
|
||||
Reference in New Issue
Block a user