Feature request: table scoping for optimize (--table / --exclude-table)
Problem
omnigraph optimize visits every node + edge table. When one table is operationally
un-compactable — in our case a blob-bearing File table (~151 GB of document blobs; since the
Lance 9.0.0-beta.15 bump removed the blob-compaction skip, optimize rewrites it) — the whole
maintenance sweep becomes unrunnable inside any reasonable operator window:
- every scheduled run dies at its timeout mid-File-rewrite, restarting that table's compaction
from scratch on the next tick, and
- crucially, index-coverage maintenance for every other table dies with it. In production
that meant fragments appended to a 751k-row vector table (Chunk, 3072-dim @embed +
@index ANN) were never folded into the index. Reads stayed correct via the planner's
brute-force flat-scan union branch, but each semantic query then pulled ~10.5 GB of raw
vectors from object storage (~60 s per query; two concurrent queries OOM'd a 24 GB host).
The blob rewrite is also a storage-headroom hazard: compaction keeps old versions reachable
until cleanup, so an unscoped run transiently near-doubles the largest table in the bucket.
Proposal
Let the operator scope the sweep:
omnigraph optimize --exclude-table File s3://… # everything except the blob table
omnigraph optimize --table Chunk --table ChunkOfArtifact s3://… # just these two
- Names resolve against the catalog as
node:<Type> / edge:<Type> or a bare type name
matching either; an unknown name errors (fail closed — a typo must not silently change the
sweep), as does a scope that selects nothing.
- Scoped runs keep the exact same per-table machinery (write gates, recovery sidecar, manifest
publish); they just visit fewer tables.
- The internal
__manifest compaction still runs regardless of scope (cheap, in-place,
content-preserving — and skipping it would let per-write metadata scans grow whenever the
operator is forced to run scoped).
Patch
We are running this in production as a minimal patch on top of v0.8.1:
https://github.com/FlorianSeemann/omnigraph/tree/p9/v0.8.1-optimize-table-scope
(OptimizeScope { include, exclude } + optimize_tables_scoped in
db/omnigraph/optimize.rs, CLI flags, and four tests in tests/maintenance.rs including a
scoped-reindex coverage test). Happy to port it onto main's reworked optimize (the graph-wide
envelope) as a PR if you want the feature — the selection logic is independent of the publish
model.
Feature request: table scoping for
optimize(--table/--exclude-table)Problem
omnigraph optimizevisits every node + edge table. When one table is operationallyun-compactable — in our case a blob-bearing
Filetable (~151 GB of document blobs; since theLance 9.0.0-beta.15 bump removed the blob-compaction skip, optimize rewrites it) — the whole
maintenance sweep becomes unrunnable inside any reasonable operator window:
from scratch on the next tick, and
that meant fragments appended to a 751k-row vector table (
Chunk, 3072-dim@embed+@indexANN) were never folded into the index. Reads stayed correct via the planner'sbrute-force flat-scan union branch, but each semantic query then pulled ~10.5 GB of raw
vectors from object storage (~60 s per query; two concurrent queries OOM'd a 24 GB host).
The blob rewrite is also a storage-headroom hazard: compaction keeps old versions reachable
until
cleanup, so an unscoped run transiently near-doubles the largest table in the bucket.Proposal
Let the operator scope the sweep:
node:<Type>/edge:<Type>or a bare type namematching either; an unknown name errors (fail closed — a typo must not silently change the
sweep), as does a scope that selects nothing.
publish); they just visit fewer tables.
__manifestcompaction still runs regardless of scope (cheap, in-place,content-preserving — and skipping it would let per-write metadata scans grow whenever the
operator is forced to run scoped).
Patch
We are running this in production as a minimal patch on top of
v0.8.1:https://github.com/FlorianSeemann/omnigraph/tree/p9/v0.8.1-optimize-table-scope
(
OptimizeScope { include, exclude }+optimize_tables_scopedindb/omnigraph/optimize.rs, CLI flags, and four tests intests/maintenance.rsincluding ascoped-reindex coverage test). Happy to port it onto
main's reworked optimize (the graph-wideenvelope) as a PR if you want the feature — the selection logic is independent of the publish
model.