Skip to content

Use uniqueness constraint for KG writer temp ids#554

Open
dylothx wants to merge 1 commit into
neo4j:mainfrom
dylothx:feat/constraints-node-key
Open

Use uniqueness constraint for KG writer temp ids#554
dylothx wants to merge 1 commit into
neo4j:mainfrom
dylothx:feat/constraints-node-key

Conversation

@dylothx

@dylothx dylothx commented Jul 5, 2026

Copy link
Copy Markdown

Description

Fixes #159

Replaces the KG writer’s temporary __KGBuilder__.__tmp_internal_id range index with a uniqueness constraint.

Neo4jWriter uses __tmp_internal_id to match nodes when creating relationships during graph writes. A plain index improves lookup performance, but does not prevent duplicate temporary ids. The new uniqueness constraint preserves indexed lookup behavior while also enforcing that temporary ids are unique during the write process.

This uses a uniqueness constraint rather than a node key constraint because __tmp_internal_id is removed during writer cleanup.

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Documentation update
  • Project configuration change

Complexity

Complexity: Low

How Has This Been Tested?

  • Unit tests
  • E2E tests
  • Manual tests

Checklist

The following requirements should have been met (depending on the changes in the branch):

  • Documentation has been updated
  • Unit tests have been updated
  • E2E tests have been updated
  • Examples have been updated
  • New files have copyright header
  • CLA (https://neo4j.com/developer/cla/) has been signed
  • CHANGELOG.md updated if appropriate

@dylothx dylothx requested a review from a team as a code owner July 5, 2026 16:37
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.

Use Constraints Instead of Plain Range Index for Node keys/ids

1 participant