Search code examples
cyphermemgraphdb

Can I paginate query results in Memgraph using Cypher query?


I encountered an out-of-memory issue and I thought I could make use of some kind of pagination of results. I'd like to divide them by 1000 at the time. This is the query that I came up with:

match(n)-[r]->(m) SKIP 1000 LIMIT 1000 return n;

Will this query though evaluate the first 1000 nodes that I just skipped?


Solution

  • Sadly, this kind of query will also evaluate the first 1000 nodes. SKIP will only skip the first 1000 results and give you a subset of the result of your query.