mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-13 16:16:56 +08:00
Updated formatting [skip ci]
This commit is contained in:
@@ -53,7 +53,7 @@ sub test_aggregate
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
# Does not raise overflow error in this instance due to loss of precision
|
# Does not raise overflow error in this instance due to loss of precision
|
||||||
is($res, "[24576,24576,49152]")
|
is($res, "[24576,24576,49152]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,25 +14,29 @@ $node->safe_psql("postgres", "CREATE EXTENSION vector;");
|
|||||||
$node->safe_psql("postgres", "CREATE TABLE tst (i serial, v sparsevec(100000));");
|
$node->safe_psql("postgres", "CREATE TABLE tst (i serial, v sparsevec(100000));");
|
||||||
$node->safe_psql("postgres", "CREATE INDEX ON tst USING hnsw (v sparsevec_l2_ops);");
|
$node->safe_psql("postgres", "CREATE INDEX ON tst USING hnsw (v sparsevec_l2_ops);");
|
||||||
|
|
||||||
for (1 .. 3) {
|
for (1 .. 3)
|
||||||
for (1 .. 100) {
|
{
|
||||||
my @elements;
|
for (1 .. 100)
|
||||||
my %indices;
|
{
|
||||||
for (1 .. int(rand() * 100)) {
|
my @elements;
|
||||||
my $index = int(rand() * (100000 - 1)) + 1;
|
my %indices;
|
||||||
if (!exists($indices{$index})) {
|
for (1 .. int(rand() * 100))
|
||||||
my $value = rand();
|
{
|
||||||
push(@elements, "$index:$value");
|
my $index = int(rand() * (100000 - 1)) + 1;
|
||||||
$indices{$index} = 1;
|
if (!exists($indices{$index}))
|
||||||
}
|
{
|
||||||
}
|
my $value = rand();
|
||||||
my $embedding = "{" . join(",", @elements) . "}/100000";
|
push(@elements, "$index:$value");
|
||||||
$node->safe_psql("postgres", "INSERT INTO tst (v) VALUES ('$embedding');");
|
$indices{$index} = 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
my $embedding = "{" . join(",", @elements) . "}/100000";
|
||||||
|
$node->safe_psql("postgres", "INSERT INTO tst (v) VALUES ('$embedding');");
|
||||||
|
}
|
||||||
|
|
||||||
$node->safe_psql("postgres", "DELETE FROM tst WHERE i % 2 = 0;");
|
$node->safe_psql("postgres", "DELETE FROM tst WHERE i % 2 = 0;");
|
||||||
$node->safe_psql("postgres", "VACUUM tst;");
|
$node->safe_psql("postgres", "VACUUM tst;");
|
||||||
is(1, 1);
|
is(1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
done_testing();
|
done_testing();
|
||||||
|
|||||||
Reference in New Issue
Block a user