@@ -270,13 +270,13 @@ CREATE VECTOR INDEX ON vec_errors (d)
270270statement error pq: column vec1 has type vector, which is not indexable in a non-vector index\nHINT: you may want to create a vector index instead
271271CREATE INDEX ON vec_errors (b, vec1)
272272
273- statement error vector indexes can' t be unique
273+ statement error vector indexes can. t be unique
274274CREATE UNIQUE VECTOR INDEX ON vec_errors (vec1)
275275
276- statement error vector indexes don' t support stored columns
276+ statement error vector indexes don. t support stored columns
277277CREATE INDEX on vec_errors USING cspann (vec1) STORING (b);
278278
279- statement error vector indexes don' t support stored columns
279+ statement error vector indexes don. t support stored columns
280280CREATE VECTOR INDEX on vec_errors (vec1) STORING (b);
281281
282282# Try to use unsupported vector index type.
@@ -331,13 +331,14 @@ DROP TABLE alter_test
331331# Execution tests.
332332# ------------------------------------------------------------------------------
333333
334+ # Use small partition size so that index has more than one level.
334335statement ok
335336CREATE TABLE exec_test (
336337 a INT PRIMARY KEY,
337338 b INT,
338339 vec1 VECTOR(3),
339- VECTOR INDEX idx1 (vec1),
340- VECTOR INDEX idx2 (b, vec1)
340+ VECTOR INDEX idx1 (vec1) WITH (min_partition_size=1, max_partition_size=4) ,
341+ VECTOR INDEX idx2 (b, vec1) WITH (min_partition_size=1, max_partition_size=4)
341342)
342343
343344statement ok
@@ -350,37 +351,29 @@ INSERT INTO exec_test (a, b, vec1) VALUES
350351 (6, NULL, '[16, 17, 18]'),
351352 (7, NULL, '[1, 1, 1]');
352353
353- # TODO(143209): write a full set of tests once we can make them deterministic.
354- # For now, we can write tests that return every vector with a given prefix.
355- query I rowsort
356- SELECT a FROM exec_test@idx1 ORDER BY vec1 <-> '[1, 1, 2]' LIMIT 7;
354+ query IT rowsort
355+ SELECT a, vec1 FROM exec_test@idx1 ORDER BY vec1 <-> '[1, 1, 2]' LIMIT 3;
357356----
358- 7
359- 1
360- 2
361- 3
362- 4
363- 5
364- 6
365-
366- query I rowsort
367- SELECT a FROM exec_test@idx2 WHERE b = 1 ORDER BY vec1 <-> '[1, 1, 2]' LIMIT 2;
357+ 7 [1,1,1]
358+ 1 [1,2,3]
359+ 2 [4,5,6]
360+
361+ query IT rowsort
362+ SELECT a, vec1 FROM exec_test@idx2 WHERE b = 1 ORDER BY vec1 <-> '[1, 1, 2]' LIMIT 1;
368363----
369- 1
370- 2
364+ 1 [1,2,3]
371365
372- query I rowsort
373- SELECT a FROM exec_test@idx2 WHERE b = 2 ORDER BY vec1 <-> '[1, 1, 2 ]' LIMIT 3 ;
366+ query IT rowsort
367+ SELECT a, vec1 FROM exec_test@idx2 WHERE b = 2 ORDER BY vec1 <-> '[15, 15, 15 ]' LIMIT 2 ;
374368----
375- 3
376- 4
377- 5
369+ 5 [13,14,15]
370+ 4 [10,11,12]
378371
379- query I rowsort
380- SELECT a FROM exec_test WHERE b IS NULL ORDER BY vec1 <-> '[1, 1, 2]' LIMIT 3;
372+ query IT rowsort
373+ SELECT a, vec1 FROM exec_test WHERE b IS NULL ORDER BY vec1 <-> '[1, 1, 2]' LIMIT 3;
381374----
382- 7
383- 6
375+ 7 [1,1,1]
376+ 6 [16,17,18]
384377
385378statement ok
386379DROP TABLE exec_test
@@ -390,7 +383,7 @@ DROP TABLE exec_test
390383#
391384# The SELECT statements for these tests retrieve all the rows in the table
392385# because the point is to test that backfill is happening correctly and that
393- # we're still able to insert into and modify the index after the backfill is
386+ # we are still able to insert into and modify the index after the backfill is
394387# done.
395388
396389subtest backfill
0 commit comments