feat: optimize() resues the first segment if possible#387
Open
JalinWang wants to merge 10 commits into
Open
Conversation
| Index::Pointer *result); | ||
|
|
||
| //! Move the index's storage file to a new path | ||
| int MoveTo(const std::string &new_path); |
|
|
||
| //! Merge all indexes into one at output_path, automatically reusing | ||
| //! the best source index to avoid rebuilding the graph from scratch. | ||
| static int MergeAll(const std::string &output_path, |
Collaborator
There was a problem hiding this comment.
函数签名不够直观,建议按照 输入(all_indexes, filter) -> 配置 (options, index_param, storage_type) -> 输出(output_path, result)的顺序
| // Current: only reuse the first index (offset math is trivial) | ||
| // Must have zero deletions & no builder (IVF has builder, needs full rebuild) | ||
| auto first_param = all_indexes[0]->GetParam(); | ||
| bool can_reuse = |
Collaborator
There was a problem hiding this comment.
这个合并策略逻辑放在这里 可能不太合适,目前合并策略强依赖输入indexers是保序的(有个隐含的id递增逻辑),对于core本身接口的使用不具备通用性。
Collaborator
|
标题:resues -> reuses |
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.
No description provided.