Skip to content

Dropping an identity document's name vectors scans every fact's evidence #1408

Closed

Description

@WaylandYang

name_vectors::drop_for_document (#1390) deletes the vectors of facts with evidence from one document, and the flag flip in sources.rs does the same for a source. fact_evidence's only index is its primary key (fact_id, chunk_id) (migrations/0003_graph.sql), so both scan the whole table. A code mirror that pushes thousands of identity documents does that once per push. Worth measuring on a large base the way #1296 was, and adding an index on document_id if it shows.

Activity

  1. WaylandYang commented on Oct 29, 2026

    @WaylandYang
    ContributorAuthor

    Fixed by #1409: the evidence index on fact_evidence(document_id) (migration 0122).

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions