[Enhance]: Reduce vector index block fragmentation caused by frequent flushes
メンテナーはふだん 1 日以内に返信
@feihongxu0824 がすでに取り組んでいます。
2026年11月2日 から。
評価
この issue はまだ評価されていません。
説明
Affected Component
Collection flush, vector index block lifecycle, querying, and optimize.
Current Behavior
While reading the source, I noticed that flush() persists pending writes and also ends the current writing block:
SegmentImpl::flush()callsfinish_memory_components(), which adds the current vector index to the persisted block list and clears the current writer references.- On the next insert,
init_memory_components()creates a new Flat vector index for the next batch. - At query time,
CombinedVectorColumnIndexer::search()searches the blocks individually and merges their results.
As a result, applications that write small batches and frequently request durability keep creating new vector index blocks:
for batch in small_batches:
collection.insert(batch)
collection.flush()
Without merging, the block count grows with the number of flushes following nonempty write batches.
Desired Improvement
It would be helpful to reduce the direct coupling between an application's durability requirements and the number of internal vector index blocks.
I understand that sealing each batch helps manage commit boundaries and crash recovery. Could we consider either:
- Separating durable log synchronization from block sealing, so applications can frequently request durability without creating many small blocks.
- Keeping the current model, but providing automatic merging based on block count or size, together with clear usage guidance.
I would also appreciate clarification on these questions:
- Is ending the current vector block on every flush primarily a consistency and crash recovery decision?
- Is there an existing mechanism that bounds the accumulation of small blocks?
- What flush and optimize policy is recommended for continuous small-batch writes that require frequent durability guarantees?
Impact
Many small blocks may increase index file and metadata overhead, as well as the cost of per-block searches and candidate merging. Requiring applications to call optimize frequently may also add maintenance overhead.
The concern here is the additional fragmentation overhead; splitting the same number of vectors across more Flat blocks does not necessarily increase the total number of distance calculations.
This is a design concern based on source inspection. I have not yet quantified the performance impact with benchmarks.
- 主要言語
- C++
- スター
- 16.3k
- フォーク
- 1k
- 平均マージ
- 2日 10時間
- マージ済み PR(30日)
- 32
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
alibaba/zvec のほかの issue
-
[Feature]: IVF_TIEREDQ index type, with a learned variable-bit codec (25–44% less index memory than `IVF_RABITQ` at equal recall)対応中かも @richyreachy が 7 日前に担当しました。 オープンfeature
メンテナーはふだん 1 日以内に返信
-
Support an opt-in portable x86 FastPFOR build without SSE4.1対応中かも @egolearner が 20 日前に担当しました。 オープン
alibaba/zvec#875 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[Performance]:High-selectivity range filter materializes a full bitmap — `bitset_set_list` ~49% CPU, dwarfing the ANN search対応中かも @zhourrr が 22 日前に担当しました。 オープンenhancement
alibaba/zvec#868 · コメント 13 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[Performance] Warm-query latency on small collections with query() and query_internal_ids() in v0.8.0再び着手できるかも @egolearner が 33 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
メンテナーはふだん 1 日以内に返信
-
[Bug]: Read-only collection concurrent query triggers permanent futex deadlock (process hangs, never recovers)再び着手できるかも @richyreachy が 34 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
-
deprecation internal refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
realloc(ptr, 0) on glibc leaves the freed block in the capture as a leak対応中かも @ADAMAMZAR が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
bloomberg/memray#1097 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
new-compilers request
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
compiler-explorer/compiler-explorer#9640 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
deepseek-ai/DeepEP#839 ·
メンテナーはふだん 6 日以内に返信