Skip to content

Commit d0f6246

Browse files
committed
Improved example [skip ci]
1 parent 8750b4a commit d0f6246

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

examples/loading/example.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,13 @@ stream.on('finish', async function () {
3737
console.log('\nSuccess!');
3838

3939
// create any indexes *after* loading initial data (skipping for this example)
40-
// console.log('Creating index');
41-
// await client.query("SET maintenance_work_mem = '8GB'");
42-
// await client.query('SET max_parallel_maintenance_workers = 7');
43-
// await client.query('CREATE INDEX ON items USING hnsw (embedding vector_cosine_ops)');
40+
const createIndex = false;
41+
if (createIndex) {
42+
console.log('Creating index');
43+
await client.query("SET maintenance_work_mem = '8GB'");
44+
await client.query('SET max_parallel_maintenance_workers = 7');
45+
await client.query('CREATE INDEX ON items USING hnsw (embedding vector_cosine_ops)');
46+
}
4447

4548
// update planner statistics for good measure
4649
await client.query('ANALYZE items');

0 commit comments

Comments
 (0)