Skip to content

Analysis: LanceDB indexing rulebook — nothing is automatic - #32

Merged
fazpu merged 1 commit into
mainfrom
analysis/lance-indexing-rulebook
Jul 7, 2026
Merged

fazpu merged 1 commit into
mainfrom
analysis/lance-indexing-rulebook

Conversation

@fazpu

@fazpu fazpu commented Jul 7, 2026

Copy link
Copy Markdown
Member

Adds plan/analysis/lance_indexing_maintenance.md — the LanceDB counterpart of the LadybugDB query rulebook (ladybug_query_semantics.md), covering the same failure class: the API accepts naive usage and fails silently — here as latency and storage-operations cost rather than wrong answers.

Content

  • §1 — three facts from the official docs (docs.lancedb.com, cited inline): LanceDB OSS creates and updates no index on its own (Enterprise auto-indexes, which is why examples/LLM priors mislead); newly written rows sit in an unindexed tail that is flat-scanned on every ANN/FTS query until optimize() runs; every write commits a fragment + version.
  • §2 — seven failure archetypes with illustrative cost arithmetic (an unindexed object-store table ≈ one storage GET per fragment per query; a ~200k×4096-dim table ≈ multi-GB flat scan per query): the zero-index table, missing scalar indexes on filter/join columns, the unbounded unindexed tail, index creation on a happy path that may never run, the frozen min-rows gate, query anti-patterns, and the retry amplifier.
  • §3 — THE RULEBOOK (R1–R11) for future agents: a table setup is not finished until its full index set exists (review bar: filtered-columns minus indexed-columns must be empty); scalar index types by cardinality (BTREE/BITMAP/LABEL_LIST/FM-index); the mandatory dual-trigger optimize() loop (unindexed rows ≥ N OR small fragments ≥ M); ensure-indexes as an explicit, idempotent, index_stats()-verified operation; batch writes; prefilter posture; BM25 substring blindness; version retention; retry caps; brute-force-is-exact vs ANN-is-approximate.
  • §4 — consequences bound for P1: the inline-write design is the unbounded-tail archetype by construction, so the p1_batch_rebuild/compaction worker is load-bearing, not hygiene; the upcoming E1/P1 design must enumerate the per-table index set as schema content.
  • README document-index row alongside the LadybugDB rulebook.

🤖 Generated with Claude Code

The LanceDB counterpart of the LadybugDB query rulebook, documenting the
same trap class: the API accepts naive usage and fails silently — here as
latency/storage-cost, not wrong answers.

- Three docs-grounded facts (OSS creates/updates no index on its own; new
  rows flat-scan as an unindexed tail until optimize(); every write is a
  fragment + version) and seven field failure archetypes, with
  illustrative cost arithmetic from the documented access patterns.
- The rulebook (R1-R11) for future agents: index-set completeness as the
  schema review bar, scalar index types by cardinality, the mandatory
  dual-trigger optimize loop, ensure-indexes as an explicit verified
  operation, batching, prefilter posture, BM25 substring blindness,
  version retention, retry caps, and dev-vs-prod ANN semantics.
- §4 binds the consequences for P1: the inline-write pattern makes the
  maintenance worker load-bearing, and the upcoming E1/P1 design must
  enumerate the per-table index set as part of the schema.
- README index row alongside the LadybugDB rulebook.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant