Problem about performance of node property update

Neo4j-community-3.5.12, cypher-shell 1.1.12

I use the dataset generated by LDBC SNB data generator with scale factor 10.

There are kinds of nodes with original id in the raw dataset. I set these original id as ori_id property as integer type in every node.

In the dataset I generated, there are 7435696 nodes with type post and 595453 nodes with type forum. The number of post nodes is about ten times that of forum nodes.

The following are the pproblems I encountered:

Query 1: match (n:forum) set n.ori_id = n.ori_id * 2; just took 5427 ms to process.

Query 2 match (n:post) set n.ori_id = n.ori_id * 2; took 6 hours but still did not finish.

I want to know why the query 2 will need so long time or if it encountered some problems when processing.

Remember that Neo4j is an ACID database, so transactional changes are built up in queries like this and must be held in memory all at once and committed atomically. 7435696 updates in a single transaction is likely stressing your heap and impacting performance, especially if you have a low amount of heap memory configured. Try batching these updates, such as via apoc.periodic.iterate()