On adapter this controls how prefetches are performed, subqueries or a list of parameters.
when under the threshold uses the parameter list, when over uses a sub query. As I understand it one of the reasons for this is a limit on the number of parameters.
I think there needs to be a third way. When the parententity fetch is expensive but is returning more than the threshold, not only is the parent entity fetch expensive but each of the prefetchs is expensive.
If the parent entity fetch was used to create a temp table containing the keys and the prefetches used (joned to) this temp table they could more cheaply return the prefetches.
If I'm looking at this right, one of my current projects takes 20 seconds to return about 3000 parent entities, the 7 prefetches then each take another 20 seconds. If I instead return 40 parents in 6 seconds the 7 prefetches each take about a second.
Am I missing something? Is this possible/practical to implement? If you can't for v2, soon after?