Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
646 views
in Technique[技术] by (71.8m points)

neo4j - neostore.* file size after deleting millions node

I use neo4j 1.9.4, i store 28M nodes, 267M properties and 157M relationships.

the neostore.* files :

-rw-r--r-- 1 user wheel 10961964959 7 fév 09:58 neostore.propertystore.db
-rw-r--r-- 1 user wheel 5185764606 7 fév 09:58 neostore.relationshipstore.db
-rw-r--r-- 1 user wheel 3550760192 7 fév 09:58 neostore.propertystore.db.strings
-rw-r--r-- 1 user wheel 249658236 7 fév 09:58 neostore.nodestore.db

I delete 26M nodes and the neostore.* is not reduce :

-rw-r--r-- 1 user wheel 10961964979 7 fév 10:20 neostore.propertystore.db
-rw-r--r-- 1 user wheel 5185764630 7 fév 10:20 neostore.relationshipstore.db
-rw-r--r-- 1 user wheel 3550760218 7 fév 10:20 neostore.propertystore.db.strings
-rw-r--r-- 1 user wheel 249658252 7 fév 10:20 neostore.nodestore.db

i remove all nodes from 'ticket' index, the lucene index /index/lucene/node/ticket folder is empty when i count all tickets nodes i get 0 -> OK

why neostore.* file size is not reduce ?

here the delete code =

EndResult<Ticket> tickets = ticketRepository.findByDate(date); // by 1000
Iterator<Ticket> itTicket = tickets.iterator(); 

  while (itTicket.hasNext()) { 

 Ticket t = itTicket.next(); 
 Node n = neo4jTemplate.getGraphDatabase().getNodeById(t.getId()); 
 neo4jTemplate.getIndex("Ticket").remove(n); 

 Iterable<Relationship> relationships = n.getRelationships(); 

  for (Relationship relationship : relationships) { 

    relationship.delete(); 
 }
 n.delete(); 

 }

Can you help me ? Charles regards

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Actually the nodestore is not instantly compacted after you delete nodes. Instead if you create new nodes they will reclaim the previously deleted ares with in nodestore.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...