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

Use provider built-in result count to reuse query if possible #3456

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

quaff
Copy link
Contributor

@quaff quaff commented Apr 29, 2024

Hibernate introduce SelectionQuery::getResultCount since 6.5.0, It may be JPA Query method in the future.

Hibernate introduce `SelectionQuery::getResultCount` since 6.5.0, It may be JPA Query method in the future.
@christophstrobl
Copy link
Member

Thank you @quaff for bringing this up. Did you eventually compare the resulting database interaction triggered by getResultCount to the count as it is done right now? Before we change the current behaviour I'd like to understand potential implications on both what the count query looks like as well as potential runtime implications.

@christophstrobl christophstrobl added status: waiting-for-feedback We need additional information before we can continue and removed status: waiting-for-triage An issue we've not yet triaged labels May 14, 2024
@quaff
Copy link
Contributor Author

quaff commented May 14, 2024

Thank you @quaff for bringing this up. Did you eventually compare the resulting database interaction triggered by getResultCount to the count as it is done right now? Before we change the current behaviour I'd like to understand potential implications on both what the count query looks like as well as potential runtime implications.

Please refer to https://github.com/hibernate/hibernate-orm/blob/8c3b68cd784076a06a4bc2a7a3d67fc32904dba3/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/select/SqmSelectStatement.java#L465

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels May 14, 2024
@mp911de mp911de force-pushed the main branch 2 times, most recently from 52ee55f to 61e6d36 Compare October 9, 2024 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: feedback-provided Feedback has been provided
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants