From 143263a66b088a2cc6e0b49c4a56015d3b5229e1 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Wed, 14 Feb 2024 15:50:24 -0800 Subject: [PATCH] Randomize type [skip ci] --- test/t/020_hnsw_filtering.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/t/020_hnsw_filtering.pl b/test/t/020_hnsw_filtering.pl index 6bd0ed5..8c299fc 100644 --- a/test/t/020_hnsw_filtering.pl +++ b/test/t/020_hnsw_filtering.pl @@ -12,7 +12,8 @@ my $limit = 20; my $dim = 3; my $array_sql = join(",", ('random()') x $dim); my $nc = 50; -my $type = "int4"; # int4, int8, text, varchar +my @types = ("int4", "int8", "text", "varchar"); +my $type = $types[rand(@types)]; sub test_recall { @@ -68,6 +69,7 @@ $node->safe_psql("postgres", "CREATE INDEX ON tst USING hnsw (v vector_l2_ops, c $node->safe_psql("postgres", "INSERT INTO tst SELECT i, ARRAY[$array_sql], i % $nc, i % $nc FROM generate_series(1, 10000) i;" ); +$node->safe_psql("postgres", "ANALYZE tst;"); # Generate queries for (1 .. 20)