Revert "Improved random_sparsevec subroutine [skip ci]"

This reverts commit 6d318c8900.
This commit is contained in:
Andrew Kane committed 2026-12-02 21:52:35 -08:00
1 parent 6d318c8900
commit 3cb6da44fa
1 file changed
+2 -3
+2 -3
View File
@@ -16,10 +16,9 @@ $node->safe_psql("postgres", "CREATE INDEX ON tst USING hnsw (v sparsevec_l2_ops
sub random_sparsevec
{
my ($nnz) = @_;
my @elements;
my %indices;
for (1 .. $nnz)
for (1 .. int(rand(1001)))
{
my $index = int(rand(100000)) + 1;
if (!exists($indices{$index}))
@@ -38,7 +37,7 @@ for (1 .. 3)
{
for (1 .. 100)
{
my $embedding = random_sparsevec(int(rand(1001)));
my $embedding = random_sparsevec();
$node->safe_psql("postgres", "INSERT INTO tst (v) VALUES ('$embedding');");
}