Skip to content

fix: remove vector index profile from owning table on dropIndex#2511

Draft
erichare wants to merge 1 commit into
feat/vector-index-options-2487from
fix/focused-wilbur-97c2cc
Draft

fix: remove vector index profile from owning table on dropIndex#2511
erichare wants to merge 1 commit into
feat/vector-index-options-2487from
fix/focused-wilbur-97c2cc

Conversation

@erichare

@erichare erichare commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #2505. createVectorIndex records a per-index profile under the owning table's VECTOR_INDEX_PROFILES extension; dropIndex left that entry behind (metadata bloat). Now dropIndex removes it.

How

  • TableExtensions.removeIndexProfile — finds the owning table via the live index, drops just that entry, and rebuilds the clobber-safe extensions payload (vectorize config + other profiles preserved). Returns empty when there's nothing to clean up, so non-profiled drops are unchanged.
  • DropVectorIndexProfileDBTask — keyspace-typed so it can share a TaskGroup with DropIndexDBTask; runs ALTER TABLE … WITH extensions sequentially after the drop.
  • KeyspaceSchemaObject.keyspaceMetadata() getter added for owning-table resolution.

Pre-existing orphans (index already gone) aren't backfilled — this only stops new bloat.

Tests

Unit tests for resolution/removal and the generated ALTER TABLE. Happy path isn't integration-testable on dse-server:6.9.21 (rejects the custom SAI params), same as #2505.

createVectorIndex persists a per-index profile record (name + applied SAI
options) under the owning table's VECTOR_INDEX_PROFILES extension. dropIndex
previously left that entry behind, so profile metadata outlived the dropped
index (metadata bloat that could later mislead a profile-echo on listIndexes).

dropIndex now resolves the owning table from the keyspace metadata and, when a
stored profile exists for the index, runs a sequential ALTER TABLE ... WITH
extensions after the drop to remove just that entry. The rewrite reuses the
clobber-safe TableExtensions.createCustomProperties so vectorize config and the
other indexes' profiles are preserved.

A keyspace-typed DropVectorIndexProfileDBTask is added so it can share a
TaskGroup with the keyspace-typed DropIndexDBTask (a TableSchemaObject-typed
AlterTableDBTask could not). KeyspaceSchemaObject exposes keyspaceMetadata()
to support owning-table resolution.

The happy path is not integration-testable on the default dse-server:6.9.21
backend (creating a profiled index needs custom SAI params it rejects),
consistent with the parent PR; the resolution + entry-removal logic is unit
tested instead.
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