-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
QuerydslJpaPredicateExecutor.exists()
solves the existence test non-optimally
#2333
Labels
type: enhancement
A general enhancement
Comments
spring-projects-issues
added
the
status: waiting-for-triage
An issue we've not yet triaged
label
Oct 12, 2021
mp911de
changed the title
QuerydslJpaPredicateExecutor.exists() solves the existence test non-optimally
Oct 13, 2021
QuerydslJpaPredicateExecutor.exists()
solves the existence test non-optimally
schauder
added
type: enhancement
A general enhancement
and removed
status: waiting-for-triage
An issue we've not yet triaged
labels
Oct 18, 2021
Sounds like a good improvement. |
quaff
added a commit
to quaff/spring-data-jpa
that referenced
this issue
Dec 3, 2021
schauder
pushed a commit
that referenced
this issue
Dec 3, 2021
schauder
pushed a commit
that referenced
this issue
Dec 3, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The current implementation of
QuerydslJpaPredicateExecutor.exists(Predicate predicate)
appears to generate aSELECT count(..) FROM ... WHERE <predicate>
query and then tests if this result is> 0
to determine if there are any results matching the predicate.For larger datasets, this is a bit inefficient. It seems that one could do a
SELECT * FROM ... WHERE <predicate> LIMIT 1
and test if any results are returned.Does this sound reasonable? If so, I can create a PR to try and address.
The text was updated successfully, but these errors were encountered: