Christian Beikov (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYWEwM2YxNTg5...
) / Improvement (
https://hibernate.atlassian.net/browse/HHH-15719?atlOrigin=eyJpIjoiYWEwM2...
) HHH-15719 (
https://hibernate.atlassian.net/browse/HHH-15719?atlOrigin=eyJpIjoiYWEwM2...
) Hint UniqueSematics.NONE for entity queries without collection join fetches (
https://hibernate.atlassian.net/browse/HHH-15719?atlOrigin=eyJpIjoiYWEwM2...
)
Issue Type: Improvement Assignee: Christian Beikov (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) Components: hibernate-core Created: 15/Nov/2022 01:59 AM Fix Versions: 6.1.6 Priority:
Major Reporter: Christian Beikov (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
In the constructor of org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan we
currently always choose ListResultsConsumer.UniqueSemantic.ALLOW , but it would be better
to use this instead:
sqm.containsCollectionFetches()
? ListResultsConsumer.UniqueSemantic.ALLOW
: ListResultsConsumer.UniqueSemantic.NONE
The deduplication showed up on some flame graphs and I realized that in that particular
case it is not even necessary, because only collection join fetches alter the cardinality
such that duplicates are possible. Maybe non-attribute joins could alter the cardinality
as well, so it might be worth being pessimistic about this for now. We could detect some
non-cardinality altering cases though if we want.
(
https://hibernate.atlassian.net/browse/HHH-15719#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15719#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100210- sha1:28a3636 )