Skip to content

#405 Batch INSERT via multi-row VALUES #407

Closed

Description

@ajianaz

Problem

Symbols, call graph edges, and knowledge graph edges are inserted one row at a time via tx.execute(INSERT) inside a loop.

Location

  • src/index/mod.rs:133-147 -- symbol inserts
  • src/index/mod.rs:153-158 -- call graph inserts
  • src/index/mod.rs:164-169 -- knowledge graph edge inserts

Solution

Use INSERT INTO ... VALUES (?1),(?2),... with chunked batching (e.g. 100 rows per statement). Reduces prepared statement overhead and SQLite parse calls.

Expected Impact

1.5x faster DB writes. Combined with #404, total indexing improvement 3-5x.

Activity

  1. added
    performance
    phase-1
    on Jul 28, 2026
  2. ajianaz commented on Jul 28, 2026

    @ajianaz
    CollaboratorAuthor

    Closed by #421 — vector index cached in process memory via LazyLock. Search went from ~250ms to ~6ms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancephase-1priority:high

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions