Best practices for queries that can take hours to complete

What is the right way to execute and get results from a query that takes hours to process? Or is just Neo4j not built to do such things? Or is there some hidden timeout limit that silently kills such queries? Or do I need the enterprise edition?

Obviously running the query in browser and waiting for the result is out of the question.

I had some success with wrapping the query into apoc.export.cypher.query() and executing it locally through cypher-shell running in background using '&' on Linux as suggested here Cypher-Shell - how to run testquery.cypher in background. Works for queries taking e.g. 20 minutes but more demanding queries seems to just die silently without leaving any trace in the logs.

If you don't need some fields in return don't return them it might greatly increase the time needed to return the values. Instead filter properties like this:

WITH keys(e) AS k1, e
UNWIND k1 AS k2
WITH e, k2 where k2 <> "relationship_string" and k2 <> "relationshipString" and RETURN id(e) AS entityId, k2 AS Prop,e[k2] AS Value

Null check in neo4j is more expensive than 'not null' check. I am performing both on an indexed field and null check takes forever.