Item 103: How to Optimize SELECT DISTINCT via Hibernate-Specific HINT_PASS_DISTINCT_THROUGH
Consider the Author and Book entities involved in a bidirectional lazy one-to-many association. The data snapshot is shown in Figure 14-1 (there is one author who has written two books).
Figure 14-1
Data snapshot (HINT_PASS_DISTINCT_THROUGH)
Further, let’s fetch the list of Author entities along with all their Book child entities. The fact is that the SQL-level result set size is given by the number ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.