CALL {..} IN TRANSACTIONS does not work properly in Neo4j 5.4?

Hi everyone,

I am trying to execute the following subquery for batching the deletion of 1+ mil nodes in my graph.

MATCH (n)
CALL{
        WITH n
        DETACH DELETE n
} IN TRANSACTIONS

When I try the above query it gives me the error that the CALL subqueries can only be executed in an implicit transaction. What is the workaround here? I have to say that it works for a low number of nodes but not for large amount of nodes.

Regards

Did you try:

IN TRANSACTIONS OF 2 ROWS

Elaine

Hi @elaine_rosenber,

Yes, I tried that as well but it does not seem to work. Below you can also find a screenshot of the error:

Thanks!

Try placing:

:auto

before the query.

Elaine

Hi @elaine_rosenber

Thanks for the input. When I try with the delete, it somehow works but when I try having some queries to do some MERGE operations on nodes and/or relationships, it still fails due to db.memory.transaction.total.max = 2GB, so it exceeds it.

Any idea on how I can optimise it to run transactions of at least 1000 rows but not to exceed the total memory of the transaction? Thanks!

Where is the database server running? Can you increase the memory for the db?

You may need to modify how much is updated at a time.

Elaine