LearnNewsExamplesServices
Frontmatter
id9940
titleEnforce Explicit SQLite Indexing on Foreign Keys schema validation
stateOpen
labels
enhancementstalearchitectureperformance
assigneestobiu
createdAtApr 12, 2026, 8:58 PM
updatedAt6:46 AM
githubUrlhttps://github.com/neomjs/neo/issues/9940
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]

Enforce Explicit SQLite Indexing on Foreign Keys schema validation

Open Backlog/active-chunk-1 enhancementstalearchitectureperformance
tobiu
tobiu commented on Apr 12, 2026, 8:58 PM

Context

During the Sandman Vector Apoptosis stabilization marathon, we discovered a fatal architectural trap: SQLite ON DELETE CASCADE foreign key bindings do NOT automatically propagate column indexing upon the child nodes. This allowed unindexed `$O(N \times M)# Enforce Explicit SQLite Indexing on Foreign Keys schema validation

Context

During the Sandman Vector Apoptosis stabilization marathon, we discovered a fatal architectural trap: SQLite ON DELETE CASCADE foreign key bindings do NOT automatically propagate column indexing upon the child nodes. This allowed unindexed Cartesian LEFT JOIN paths to silently deadlock the Node.js V8 execution thread processing better-sqlite3 operations on Native Edge Graphs over 50,000 vectors deep.

Scope

While the Edges(source) and Edges(target) indexes were explicitly injected via #9938, we must harden the SQLite.mjs WAL Engine structure:

  1. Implement a diagnostic schema assertion inside initSchema() that actively tests database index coverage mappings natively upon system start.
  2. Extend buildScripts/ai/defragSQLiteDB.mjs to execute an index mapping validation routine right before executing its SQLite VACUUM loop to explicitly ensure that any dynamically deployed edge tables from external Swarm Skills natively inherit the required index paths.

Origin Session

Origin Session ID: af26000d-914a-4eb0-8d28-2c09e9cb4cb5

tobiu added the enhancement label on Apr 12, 2026, 8:59 PM
tobiu added the architecture label on Apr 12, 2026, 8:59 PM
tobiu added the performance label on Apr 12, 2026, 8:59 PM
tobiu assigned to @tobiu on Apr 12, 2026, 8:59 PM