From 7d75d423e43ada8ce28b83ea8721be8e570fe7ed Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Tue, 9 Jan 2024 13:27:27 -0800 Subject: [PATCH] Added section on index build time [skip ci] --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 5d0efc0..093bf79 100644 --- a/README.md +++ b/README.md @@ -190,6 +190,22 @@ CREATE INDEX ON items USING hnsw (embedding vector_cosine_ops); Vectors with up to 2,000 dimensions can be indexed. +### Index Build Time + +Indexes build significantly faster when the graph fits into `maintenance_work_mem` + +```sql +SET maintenance_work_mem = '8GB'; +``` + +A notice is shown when the graph no longer fits + +```text +NOTICE: hnsw graph no longer fits into maintenance_work_mem after 100000 tuples +DETAIL: Building will take significantly more time. +HINT: Increase maintenance_work_mem to speed up builds. +``` + ### Index Options Specify HNSW parameters