Skip to content

[FEATURE REQ] spring-data-cosmos paging without incurring cost of count query for custom query using paginationQuery method.  #23484

Closed

Description

Is your feature request related to a problem? Please describe.
I want to page through a large result set using continuation tokens and the azure-spring-data-cosmos library method which will accept my query with return argument. However, CosmosTemplate repository methods(paginationQuery) always issue a count query to populate the total elements in the page response, and when the query is complex and the result set is large, the count query can be very expensive.

Describe the solution you'd like
I would like to be able to use CosmosPageRequest to fetch a page of data with a continuation token without issuing a count query to populate the total elements. There is a private slice method in CosmosTemplate which is called from paginationQuery method after executing count query , would like a wrapper public method of that so that it can call directly to avoid count query .Existing private method private Slice sliceQuery(SqlQuerySpec querySpec,Pageable pageable, Sort sort,Class returnType, String containerName)
Describe alternatives you've considered
Considered extending CosmosTemplate, but too many fields and methods are defined with private access modifiers.

Additional context
Add any other context or screenshots about the feature request here.

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Description Added
  • Expected solution specified
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Labels

ClientThis issue points to a problem in the data-plane of the library.azure-springAll azure-spring related issuesazure-spring-cosmosSpring cosmos related issues.customer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions