Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
07-31-2019 06:20 AM
Hello,
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.
07-31-2019 02:42 PM
SKIP and LIMIT are indeed how pagination is done for results in Neo4j. SKIP effectively controls where to start (which page number you're one) and LIMIT controls how many are on a page.
SKIP and LIMIT themselves are very fast, so if you're experiencing slowness issues this may be due to the query you're paginating rather than the pagination itself. I recommend doing an EXPLAIN on the query to see the plan, and look for ways of improving the query to minimize dbHits.
08-01-2019 01:48 AM
Hello,
Firstly, thank you for replying to me.
How to use a variable with SKIP ( for calculing the number for rows to skip).
I was talking about ORDER BY when i said it slows the execution, so please, is there a way to retreive the data without duplicate the same data in two different querys of (SKIP, LIMIT) without using ORDER BY.
Thank you in advance.
08-01-2019 05:51 AM
To use a variable, these are called "parameters" in cypher queries.
In Neo4j browser for example you can do this:
:set n => 5
MATCH (node) RETURN node LIMIT $n
If you are using an official driver with neo4j, look into the docs for your language on how to use parameters in your cypher queries. All official drivers support this and will do that.
As for your order by question - I'm not sure. It would help if you post the cypher. Please open another question thread on that (because the title of this one will not attract other help on an order by topic). Post your cypher, and state what you're trying to make happen
08-01-2019 08:05 AM
Hello, thank you for replying to me.
So, i create another topic like you said to me, here is the link : Neo4j : Using ORDER BY with SKIP and LIMIT, is it the better way to get a good performance ( executi...
Thank you in advance.
All the sessions of the conference are now available online