DETACH DELETE taking long time to execute

I have tried to execute cypher sql with delete detach but it is taking longer time for 1000 records it's running for more than 1hr. can you please help how we can traceback the issue

Query - MATCH (n:Test) WHERE n.created_at < LocalDateTime('2024-02-20') CALL{WITH n DETACH DELETE n} IN TRANSACTIONS OF 100 ROWS;

Error after 30 min -

neo4j.exceptions.ClientError: {code: Neo.ClientError.Transaction.LockClientStopped} {message: The transaction has been terminated. Retry your operation in a new transaction, and you should see a successful result. The transaction has been terminated, so no more locks can be acquired. This can occur because the transaction ran longer than the configured transaction timeout, or because a human operator manually terminated the transaction, or because the database is shutting down. ForsetiClient[transactionId=11412, clientId=29]}

@manish.kumar6

your cypher is going to batch every 100 :Test nodes and then delete all relationships for said 100 nodes and then the source node.

if you have 1 node which has 300k relationships then just to get rid of this 1 :Test node is really 300k+1 deletes. Do you have nodes which have a great number of relationships?