feature: repack fragments whose files carry many dead column slots

Abierto
#11,035 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
15/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Activo
Stack tecnológico
rust
Área
data

Línea de trabajo

Start with Dataset::column_layout_stats and its dead_slot_ratio, then the compact_files planner that uses max_data_files_per_fragment, and see how UpdateMode::RewriteColumns and drop_columns leave dead slots. The open questions are design decisions (slots vs bytes, one-file rewrites, option naming and combination), so the first step is a maintainer decision, not a patch. Done means those choices are settled in the issue and a follow-up scopes the implementation.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

feature

Motivation

#9604 adds column repack tasks to compact_files. The file count is the only trigger: a fragment is repacked when it holds its columns in more than max_data_files_per_fragment data files. In review, a question came up about other conditions that should plan a repack, such as the dead weight an in-place column rewrite leaves behind.

Two operations leave slots that are dead in the latest version but sit in a file that still holds live columns:

  • an in-place rewrite of a column that shares a file with others (UpdateMode::RewriteColumns, or a DataReplacement with data_change: true) tombstones it in that file and writes the new values to a new file;
  • drop_columns leaves the dropped field's id in the file that held it.

Dataset::column_layout_stats already reports this per fragment as dead_slot_ratio. Today those bytes are reclaimed only when something else rewrites the fragment, when a repack happens to empty the file, or, for a file holding spilled row lineage next to user columns that are all dead, by the existing rewrite trigger for that case.

Open questions

  1. Slots or bytes. The manifest records only whole-file sizes, so the ratio counts dead slots, not dead bytes: a dead int32 column and a dead 1024-dim embedding move it by about the same amount. Per-column sizes would mean reading file metadata at plan time, which the planner avoids today, or recording them in the manifest.
  2. One-file rewrites. A repack only merges files it can empty, at least two at a time, so every task lowers the file count. Reclaiming a dead slot in a file that keeps live columns takes a task that rewrites that one file. The new file holds no dead slots, so the trigger cannot fire on it again.
  3. Options. A name and default (say max_dead_slot_ratio, off by default), how it combines with max_data_files_per_fragment in one task, and whether a fragment that also qualifies for a rewrite (deletions, overlays) should simply be rewritten.
Lenguaje dominante
Rust
Estrellas
7.3k
Forks
929
Merge medio
2 d 22 h
PR fusionados (30 d)
572

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de lance-format/lance

Todos los issues de lance-format/lance

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.