fix: hierarchical document by review#159
Closed
cutecutecat wants to merge 1 commit intotensorchord:mainfrom
Closed
fix: hierarchical document by review#159cutecutecat wants to merge 1 commit intotensorchord:mainfrom
cutecutecat wants to merge 1 commit intotensorchord:mainfrom
Conversation
Signed-off-by: cutecutecat <junyuchen@tensorchord.ai>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
usamoi
reviewed
Jan 4, 2026
usamoi
reviewed
Jan 4, 2026
usamoi
reviewed
Jan 4, 2026
usamoi
reviewed
Jan 4, 2026
| If the build speed is still unsatisfactory, you can use the hierarchical clustering to accelerate the process at the expense of some accuracy. In our [benchmark](https://blog.vectorchord.ai/how-we-made-100m-vector-indexing-in-20-minutes-possible-on-postgresql#heading-hierarchical-k-means), the hierarchical clustering was 100 times faster than the default algorithm, while query accuracy decreased by less than 1%. | ||
| For large tables with more than 50 million rows, the `build.internal` process requires significant time and memory. Let $D$ be the vector dimension used for partition, $C$ be `build.internal.lists[-1]`, $F$ be `build.internal.sampling_factor`, $L$ be `build.internal.kmeans_iterations`, and $T$ be `build.internal.build_threads`. The build time is approximately $O(FC^2DL)$, which usually takes more than one day. | ||
|
|
||
| If this applies to you, you can use the hierarchical clustering to speed up the process, albeit at the expense of some accuracy. In our [benchmark](https://blog.vectorchord.ai/how-we-made-100m-vector-indexing-in-20-minutes-possible-on-postgresql#heading-hierarchical-k-means), hierarchical clustering was 100 times faster than the default algorithm, while query recall decreased only from 95.6% to 94.9%. |
Collaborator
There was a problem hiding this comment.
What's If this applies to you,? Not 100 times, should be 400 times.
usamoi
reviewed
Jan 4, 2026
usamoi
reviewed
Jan 4, 2026
| --- | ||
| ## Tuning: Optimize the memory usage with indexing | ||
|
|
||
| When the indexing process starts, VectorChord shows the estimated amount of memory that will be allocated, such as: |
Collaborator
There was a problem hiding this comment.
It does not specify where this will be displayed. In addition, due to settings, users may not see this message at all.
usamoi
reviewed
Jan 4, 2026
|
|
||
| When the indexing process starts, VectorChord shows the estimated amount of memory that will be allocated, such as: | ||
|
|
||
| ```shell |
usamoi
reviewed
Jan 4, 2026
| INFO: clustering: estimated memory usage is 1.49 GiB | ||
| ``` | ||
|
|
||
| If the value exceeds your expectations or the physical memory constraint, it is wise to cancel and check this chapter. There are some options that can help reduce memory usage. |
usamoi
reviewed
Jan 4, 2026
usamoi
reviewed
Jan 4, 2026
usamoi
reviewed
Jan 4, 2026
usamoi
reviewed
Jan 4, 2026
| * C: `build.internal.lists[-1]`. | ||
|
|
||
| If you encounter an Out-of-Memory (OOM) error, reducing $D$, $C$ or $F$ will lower the memory usage. Based on our [experience](https://blog.vectorchord.ai/how-we-made-100m-vector-indexing-in-20-minutes-possible-on-postgresql#heading-dimensionality-reduction), reducing `D` will have the least impact on accuracy, so that could be a good starting point. Decreasing `F` is also plausible. Since `C` is much more sensitive, it should be the last thing you consider. | ||
| Based on our [experience](https://blog.vectorchord.ai/how-we-made-100m-vector-indexing-in-20-minutes-possible-on-postgresql#heading-dimensionality-reduction), reducing `D` will have the least impact on accuracy, so that could be a good starting point. Decreasing `F` is also plausible. Since `C` is much more sensitive, it should be the last thing you consider. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix by most comments in #158