Node ID reliability?

Matching on ID is super fast, and I’d like to standardize on it if possible. However, I’ve read that Neo4j reuses its internal ids when nodes are deleted:

https://community.neo4j.com/t/is-it-reliable-to-depend-on-node-id-to-query-data/10299/2

Does RedisGraph also reuse node IDs when they get deleted? Is it standard practice to query using node IDs, or is it standard to instead use a node property?

1 Like

Hi @bstanley,

RedisGraph also reuses the IDs of deleted nodes and edges, so caution is recommended!

Queries of the form MATCH (a) WHERE ID(a) = 100 do use an optimized ID Seek lookup, but it’s common practice to create an index on an ID field to ensure immutable IDs - this is also quite fast.

2 Likes

Thanks @jeffreylovitz , this is exactly what I was looking for.

Much appreciated!