Add @LargeTable annotation to allow entities to be marked and for different query logic to be applied to them.
Introduce hibernate.perform-separate-id-query-for-large-tables=true to allow findByUriQuery to execute differently for @LargeTable, executing an id-projection initially, followed by an "id IN (collection)" criteria with the appropriate joins and orders specified.

The rationale for this is:
I noticed a performance issue in SQL Server whereby it produces crazy plans when doing joins and where the number of rows in the resultset is limited only by a TOP n (or, more broadly, where the number of results from the clustered index are very large): SQL Server will perform the join on the entire table and then sort the resultset and apply the TOP n logic (I noticed one query take 262 seconds for ~600k rows, while the same query rewritten as a subquery that added a "WHERE id IN (SELECT TOP n id FROM table ORDER BY ...)" clause took ~6 seconds. Executing the TOP n separately allowed the query planner to use an index it ordinarily wouldn't have used).