On 5/12/06, Cris Daniluk <[EMAIL PROTECTED]> wrote:
I think this is more a limitation of the current prefetch behavior,
than an actual bug. You may want to experiment with the prefetch
"advice", or semantics:

http://objectstyle.org/confluence/display/CAYDOC/Prefetching

I'm assuming you're using 1.2 latest release, of course. If you're
using something that's not 1.1 latest or 1.2 latest, then it will be
hard to talk about it. Anyway, if the docs don't provide any helpful
info, please post the debugging output - specifically, the queries
that are executed in this case.

I'm sorry I didn't make it completely clear: I'm using cayenne 1.2B2
(see subject line).
Also, I'm very thankfull for the hint about prefetch semantics: I
didn't really think about what was going on under the hood, up untill
now.
I gave PrefetchTreeNode.JOINT_PREFETCH_SEMANTICS a try and got
*exactly* the join I wanted:

QueryLogger:
SELECT (...t0.fieldlist, t1.fieldlist...)
FROM main.first_table t0, main.second_table t1
WHERE t0.id = t1.id AND (t0.attr ILIKE ?) LIMIT 50 [bind: '%a%'] -
prepared in 18 ms.

Now, the problem is that not knowing about prefetch semantics, I
expected the prefetch to *just work* i.e. deduce which records in the
other table I really require, instead of fetching all of them.
I still think there's no use case to support the default prefetch
behaviour that gave me problems in the first place: if the query on
the primary table is limited to no more than a 100 records, why would
the prefetch go for all the records of the secondary table?

t.n.a.

Reply via email to