Skip to content

Neptune snapshot queries fetch soft-deleted records unnecessarily #613

@haasonsaas

Description

@haasonsaas

Problem

neptuneSnapshotNodesQuery and neptuneSnapshotEdgesQuery fetch all records including soft-deleted ones (deleted_at IS NOT NULL), then filter client-side in the Snapshot() method to count active vs deleted records.

At scale this transfers significantly more data than needed from Neptune to the application.

Expected behavior

The snapshot queries should either:

  1. Filter out soft-deleted records server-side with WHERE n.deleted_at IS NULL (if deleted records aren't needed in the snapshot), or
  2. Use two separate queries — one for active records and one for counts — to avoid transferring deleted record payloads

Affected code

  • internal/graph/store_neptune.goneptuneSnapshotNodesQuery (lines 905–926), neptuneSnapshotEdgesQuery (lines 928–943), Snapshot() (lines 281–345)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priorityenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions