Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit656b059

Browse files
committed
Added tests for iterative index scan with empty index -resolvespgvector#679 [skip ci]
1 parent7cf9980 commit656b059

File tree

4 files changed

+21
-0
lines changed

4 files changed

+21
-0
lines changed

‎test/expected/hnsw_vector.out

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ SELECT * FROM t ORDER BY val <-> '[3,3,3]';
123123
[0,0,0]
124124
(3 rows)
125125

126+
TRUNCATE t;
127+
SELECT * FROM t ORDER BY val <-> '[3,3,3]';
128+
val
129+
-----
130+
(0 rows)
131+
126132
RESET hnsw.iterative_scan;
127133
RESET hnsw.ef_search;
128134
DROP TABLE t;

‎test/expected/ivfflat_vector.out

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,15 @@ SELECT * FROM t ORDER BY val <-> '[3,3,3]';
110110
[1,1,1]
111111
(2 rows)
112112

113+
TRUNCATE t;
114+
NOTICE: ivfflat index created with little data
115+
DETAIL: This will cause low recall.
116+
HINT: Drop the index until the table has more data.
117+
SELECT * FROM t ORDER BY val <-> '[3,3,3]';
118+
val
119+
-----
120+
(0 rows)
121+
113122
RESET ivfflat.iterative_scan;
114123
RESET ivfflat.max_probes;
115124
DROP TABLE t;

‎test/sql/hnsw_vector.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ SELECT * FROM t ORDER BY val <-> '[3,3,3]';
7070
SEThnsw.iterative_scan= relaxed_order;
7171
SELECT*FROM tORDER BY val<->'[3,3,3]';
7272

73+
TRUNCATE t;
74+
SELECT*FROM tORDER BY val<->'[3,3,3]';
75+
7376
RESEThnsw.iterative_scan;
7477
RESEThnsw.ef_search;
7578
DROPTABLE t;

‎test/sql/ivfflat_vector.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ SELECT * FROM t ORDER BY val <-> '[3,3,3]';
5959
SETivfflat.max_probes=2;
6060
SELECT*FROM tORDER BY val<->'[3,3,3]';
6161

62+
TRUNCATE t;
63+
SELECT*FROM tORDER BY val<->'[3,3,3]';
64+
6265
RESETivfflat.iterative_scan;
6366
RESETivfflat.max_probes;
6467
DROPTABLE t;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp