How to paginate results of cypher, neo4j?

724 Views Asked by At

i am currently working with neo4j, if anybody knows how to do pagination with the results that a cypher query gives, specialy the size of the results is so big, about 100 millions.

i know the methode of skip and limit and order by (which is not good, it takes a long time). so is there anyone knows another efficient methode to do the pagination.

thank you in advance.

2

There are 2 best solutions below

5
cybersam On

The APOC periodic execution procedures may work for you.

For example, apoc.periodic.iterate allows you to execute a query (referred to as the "inner query") in batches of a specific size.

0
canbax On

Actually, you don't need order by clause. You can use SKIP and LIMIT like RETURN x SKIP 0 LIMIT 15. I think its performance should be better.