1

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 Answers2

0

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.

cybersam
  • 63,203
  • 6
  • 53
  • 76
  • 0 Firstly, thank you for replying to me. So, i have already tried the function apoc.periodic.iterate and what i have understood is that this function is useful just when we want to update our database (insert, delete ...etc) (it doesn't return the results to externe in each iteration), it's not for the pagination of the results. Please, correct me if i am wrong. Thank you in advance. – Trustiser-Habiba Aug 01 '19 at 08:05
  • You are correct. It is not for returning blocks of results back to the client. Can you amend your question to provide details of your data model and specific use case? – cybersam Aug 01 '19 at 17:30
  • @Trustiser-Habiba Were you able to find any solutions – TheRedCamaro3.0 3.0 Nov 20 '19 at 03:10
  • @TheRedCamaro3.03.0 Hello, No i didn't find much things yet. – Trustiser-Habiba Dec 15 '19 at 09:33
  • @Trustiser-Habiba Thank you for your response I appreciate the help – TheRedCamaro3.0 3.0 Dec 18 '19 at 07:46
-1

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.

canbax
  • 3,432
  • 1
  • 27
  • 44