Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Paging Support for HTTP Endpoints #245

Open
thombergs opened this issue Apr 1, 2019 · 1 comment
Open

Add Paging Support for HTTP Endpoints #245

thombergs opened this issue Apr 1, 2019 · 1 comment
Assignees

Comments

@thombergs
Copy link
Member

Go through the HTTP endpoints and identify those that need paging.

Implement paging for these endpoints (see tutorial at https://reflectoring.io/spring-boot-paging/)

@KilianKrause KilianKrause self-assigned this Apr 1, 2019
@maximAtanasov
Copy link
Member

maximAtanasov commented Nov 26, 2019

Paging for custom queries is in fact supported in SDN
https://community.neo4j.com/t/pagination-and-sorting-with-custom-queries/1991
We should give it a shot.

EDIT:
Paging does indeed work in SDN. I implemented it for the project/{id}/commits endpoint.
This is what the query looks like:

  @Query(
          value = "MATCH (p)-[:CONTAINS_COMMIT]->(c) WHERE ID(p) = {0} RETURN c ORDER BY c.timestamp DESC",
          countQuery = "MATCH (p:ProjectEntity)-[:CONTAINS_COMMIT]->(c) WHERE ID(p) = {0} RETURN COUNT(c)")
  @NonNull
  Page<CommitEntity> findByProjectIdAndTimestampDescPaged(@NonNull Long projectId, @NonNull Pageable page);

I also implemented paging in the front-end and configured the paginators to load new pages on demand.
However, clicking through the pages feels very sluggish and unresponsive. Considering we can load a lot of commits without pagination (maximum I've tried was 66655 commits) in a very short time and still browse them comfortably, I think we should discuss in what cases we need to page data and whether we even should.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants