# Noe4j Performance Impact with deletion

**URL:** <https://community.neo4j.com/t/noe4j-performance-impact-with-deletion/3151>\
**Category:** Neo4j Graph Platform\
**Tags:** performance\
**Created:** [November 21, 2018, 9:14am UTC](https://community.neo4j.com/t/noe4j-performance-impact-with-deletion/3151 "2018-11-21T09:14:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jalesar2011](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/jalesar2011/32/2111_2.png) [@jalesar2011](https://community.neo4j.com/u/jalesar2011)\
**Post date:** [November 21, 2018, 9:14am UTC](https://community.neo4j.com/t/noe4j-performance-impact-with-deletion/3151/1 "2018-11-21T09:14:24Z")

</div>

My graph contains 2.5 Milion nodes.  
Current graph size is 58G.  
Machine RAM = 24G.  
We need to do the cleanup of DB. We have to delete 10 Millions of nodes with their attached relations. As documented graph size (disk) will not reduce because of the re-use of ids.  
Will this deletion improve query performance (Read/Write).  
Any suggestions for running store utils for compacting DB on production systems.

---

<div class="post-metadata">

**Author:** ![michael.hunger](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/michael.hunger/32/27377_2.png) [@michael.hunger](https://community.neo4j.com/u/michael.hunger)\
**Post date:** [November 21, 2018, 10:27am UTC](https://community.neo4j.com/t/noe4j-performance-impact-with-deletion/3151/2 "2018-11-21T10:27:27Z")

</div>

Actually re-use will allow you to update your graph without changing of graph sizes.  
So your graph shouldn't grow if you are deleting/adding nodes over the course of a day.

If you do huge operations, you'd have to wait for or change the grace period for id-reuse.

Compaction will help with disk and memory use, esp. if you have fragementation and partially filled pages.

You can run store-utils on a copy/backup and then test it afterwards.

---

<div class="post-metadata">

**Author:** ![jalesar2011](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/jalesar2011/32/2111_2.png) [@jalesar2011](https://community.neo4j.com/u/jalesar2011)\
**Post date:** [November 21, 2018, 3:36pm UTC](https://community.neo4j.com/t/noe4j-performance-impact-with-deletion/3151/3 "2018-11-21T15:36:51Z")

</div>

Hi,

Number of nodes to be deleted are more than 40%. so deletion is the only way for cleanup.  
We are setting up casual cluster, How should we run store-utils for compaction on production ?  
Is there any chances of data mismatch in case of cluster (Replica or core) ?  
And will only deletion is sufficient to reduce the RAM used by db or compaction will help in this?

Thanks

---

<div class="post-metadata">

**Author:** ![michael.hunger](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/michael.hunger/32/27377_2.png) [@michael.hunger](https://community.neo4j.com/u/michael.hunger)\
**Post date:** [November 23, 2018, 12:45am UTC](https://community.neo4j.com/t/noe4j-performance-impact-with-deletion/3151/4 "2018-11-23T00:45:38Z")

</div>

I honestly think that you're best off with deletion and record-reuse.

You can reduce the grace period to something lower than 1hr, e.g. 1 to 10 minutes.

Then your the records marked as unused for deleted node and relationship records will be reused for the new data.

---

<div class="post-metadata">

**Author:** ![jalesar2011](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/jalesar2011/32/2111_2.png) [@jalesar2011](https://community.neo4j.com/u/jalesar2011)\
**Post date:** [November 23, 2018, 8:05am UTC](https://community.neo4j.com/t/noe4j-performance-impact-with-deletion/3151/5 "2018-11-23T08:05:30Z")

</div>

Hi Michael,

I didn't get the concept of the grace period. is it a config to delete automatically deleted ids.  
After deletion of data, will it use less memory (RAM) because graph size is the same?

Thanks

---

<div class="post-metadata">

**Author:** ![michael.hunger](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/michael.hunger/32/27377_2.png) [@michael.hunger](https://community.neo4j.com/u/michael.hunger)\
**Post date:** [November 26, 2018, 2:39am UTC](https://community.neo4j.com/t/noe4j-performance-impact-with-deletion/3151/6 "2018-11-26T02:39:09Z")

</div>

It does never delete records, just reuse them.  
The grace period is for reuse.
