Skip to content

Commit 6964420

Browse files
committed
Improved example [skip ci]
1 parent 8a18d9f commit 6964420

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

examples/bulk_loading.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@
3030
puts "\nSuccess!"
3131

3232
# create any indexes *after* loading initial data (skipping for this example)
33-
# puts "Creating index"
34-
# conn.exec("SET maintenance_work_mem = '8GB'")
35-
# conn.exec("SET max_parallel_maintenance_workers = 7")
36-
# conn.exec("CREATE INDEX ON items USING hnsw (embedding vector_cosine_ops)")
33+
create_index = false
34+
if create_index
35+
puts "Creating index"
36+
conn.exec("SET maintenance_work_mem = '8GB'")
37+
conn.exec("SET max_parallel_maintenance_workers = 7")
38+
conn.exec("CREATE INDEX ON items USING hnsw (embedding vector_cosine_ops)")
39+
end
3740

3841
# update planner statistics for good measure
3942
conn.exec("ANALYZE items")

0 commit comments

Comments
 (0)