[Enhance]: Reduce vector index block fragmentation caused by frequent flushes
Los mantenedores suelen responder en 1 día
@feihongxu0824 ya está trabajando en esto.
Desde el 2/11/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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.
- Lenguaje dominante
- C++
- Estrellas
- 16.3k
- Forks
- 1k
- Merge medio
- 2 d 10 h
- PR fusionados (30 d)
- 32
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de alibaba/zvec
-
[Feature]: IVF_TIEREDQ index type, with a learned variable-bit codec (25–44% less index memory than `IVF_RABITQ` at equal recall)Posiblemente ocupada @richyreachy la tomó hace 7 días. Abiertofeature
alibaba/zvec#909 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Support an opt-in portable x86 FastPFOR build without SSE4.1Posiblemente ocupada @egolearner la tomó hace 20 días. Abierto
alibaba/zvec#875 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[Performance]:High-selectivity range filter materializes a full bitmap — `bitset_set_list` ~49% CPU, dwarfing the ANN searchPosiblemente ocupada @zhourrr la tomó hace 22 días. Abiertoenhancement
alibaba/zvec#868 · 13 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[Performance] Warm-query latency on small collections with query() and query_internal_ids() in v0.8.0Quizá libre de nuevo @egolearner la tomó hace 33 días y no hay ningún pull request abierto. Abierto
alibaba/zvec#841 · 2 asignados ·
Los mantenedores suelen responder en 1 día
-
[Bug]: Read-only collection concurrent query triggers permanent futex deadlock (process hangs, never recovers)Quizá libre de nuevo @richyreachy la tomó hace 34 días y no hay ningún pull request abierto. Abiertobug
alibaba/zvec#837 · 2 asignados ·
Los mantenedores suelen responder en 1 día
Todos los issues de alibaba/zvec
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
-
deprecation internal refactor
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
realloc(ptr, 0) on glibc leaves the freed block in the capture as a leakPosiblemente ocupada @ADAMAMZAR la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
bloomberg/memray#1097 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
new-compilers request
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
compiler-explorer/compiler-explorer#9640 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
deepseek-ai/DeepEP#839 ·
Los mantenedores suelen responder en 6 días