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

Feature Request: Option to Disable Total Count in Spring Data REST for Improved Performance (or use Slice interface) #2426

Open
cjullien opened this issue Oct 29, 2024 · 0 comments
Assignees
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@cjullien
Copy link

cjullien commented Oct 29, 2024

I’d like to request a new feature that allows disabling the total count (count) in Spring Data REST endpoints. In some scenarios, especially with large datasets, counting all entities for pagination can lead to significant performance issues. Therefore, I believe it would be beneficial to have a configurable option to bypass the count query when it’s not essential for the client application.

Suggested Feature
Add a configuration option in Spring Data REST to:

Disable the total count in all paginated responses or use the Slice interface instead of Page for default find.
Optionally control the count per query/request: Allow overriding the count calculation on a per-request basis by setting a query parameter or using an annotation on repository methods.

Use Case

In cases where only the data of the current page is necessary (without the need for total elements) or with many data in bdd, the count query adds overhead. Disabling it could significantly improve response times for paginated endpoints working with large datasets.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

3 participants