[Enhance]: Reduce vector index block fragmentation caused by frequent flushes
I maintainer di solito rispondono entro 1 giorno
@feihongxu0824 ci sta già lavorando.
Dal 2/11/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- C++
- Stelle
- 16.3k
- Fork
- 1k
- Merge medio
- 2g 10h
- PR unite (30g)
- 32
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di alibaba/zvec
-
[Feature]: IVF_TIEREDQ index type, with a learned variable-bit codec (25–44% less index memory than `IVF_RABITQ` at equal recall)Forse già presa @richyreachy l’ha presa 7 giorni fa. Apertafeature
alibaba/zvec#909 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Support an opt-in portable x86 FastPFOR build without SSE4.1Forse già presa @egolearner l’ha presa 20 giorni fa. Aperta
alibaba/zvec#875 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[Performance]:High-selectivity range filter materializes a full bitmap — `bitset_set_list` ~49% CPU, dwarfing the ANN searchForse già presa @zhourrr l’ha presa 22 giorni fa. Apertaenhancement
alibaba/zvec#868 · 13 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[Performance] Warm-query latency on small collections with query() and query_internal_ids() in v0.8.0Forse di nuovo libera @egolearner l’ha presa 33 giorni fa e non c’è nessuna pull request aperta. Aperta
alibaba/zvec#841 · 2 assegnatari ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: Read-only collection concurrent query triggers permanent futex deadlock (process hangs, never recovers)Forse di nuovo libera @richyreachy l’ha presa 34 giorni fa e non c’è nessuna pull request aperta. Apertabug
alibaba/zvec#837 · 2 assegnatari ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di alibaba/zvec
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
deepseek-ai/DeepEP#839 ·
I maintainer di solito rispondono entro 6 giorni
-
multilabel_margin_loss returns an unwritten scalar for an empty CPU batch with reduction='sum'Apertabot-triaged module: correctness (silent) module: cpu module: empty tensor module: loss triage review
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
stephenberry/glaze#3126 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ultravideo/kvazaar#453 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
google-ai-edge/LiteRT-LM#4783 ·
I maintainer di solito rispondono entro 1 giorno