From d64295dfd756d7582a4bed7878ee1911504837ef Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Wed, 10 Apr 2024 16:38:07 -0700 Subject: [PATCH] Improved test SQL [skip ci] --- test/t/020_hnsw_bit_build_recall.pl | 2 +- test/t/023_hnsw_bit_insert_recall.pl | 2 +- test/t/029_hnsw_bit_vacuum_recall.pl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/t/020_hnsw_bit_build_recall.pl b/test/t/020_hnsw_bit_build_recall.pl index d60f98c..6ccc22a 100644 --- a/test/t/020_hnsw_bit_build_recall.pl +++ b/test/t/020_hnsw_bit_build_recall.pl @@ -85,7 +85,7 @@ for my $i (0 .. $#operators) # Handle ties my $res = $node->safe_psql("postgres", qq( WITH top AS ( - SELECT v $operator $_ AS distance FROM tst ORDER BY v $operator $_ LIMIT $limit + SELECT v $operator $_ AS distance FROM tst ORDER BY distance LIMIT $limit ) SELECT i FROM tst WHERE (v $operator $_) <= (SELECT MAX(distance) FROM top) )); diff --git a/test/t/023_hnsw_bit_insert_recall.pl b/test/t/023_hnsw_bit_insert_recall.pl index bee72d7..8e6a1ac 100644 --- a/test/t/023_hnsw_bit_insert_recall.pl +++ b/test/t/023_hnsw_bit_insert_recall.pl @@ -98,7 +98,7 @@ for my $i (0 .. $#operators) my $res = $node->safe_psql("postgres", qq( SET enable_indexscan = off; WITH top AS ( - SELECT v $operator $_ AS distance FROM tst ORDER BY v $operator $_ LIMIT $limit + SELECT v $operator $_ AS distance FROM tst ORDER BY distance LIMIT $limit ) SELECT i FROM tst WHERE (v $operator $_) <= (SELECT MAX(distance) FROM top) )); diff --git a/test/t/029_hnsw_bit_vacuum_recall.pl b/test/t/029_hnsw_bit_vacuum_recall.pl index ccff0db..8a0a613 100644 --- a/test/t/029_hnsw_bit_vacuum_recall.pl +++ b/test/t/029_hnsw_bit_vacuum_recall.pl @@ -83,7 +83,7 @@ foreach (@queries) my $res = $node->safe_psql("postgres", qq( SET enable_indexscan = off; WITH top AS ( - SELECT v <~> $_ AS distance FROM tst ORDER BY v <~> $_ LIMIT $limit + SELECT v <~> $_ AS distance FROM tst ORDER BY distance LIMIT $limit ) SELECT i FROM tst WHERE (v <~> $_) <= (SELECT MAX(distance) FROM top) ));