Re: flattened prefetches

From: Cris Daniluk (cris.danilu..mail.com)
Date: Mon Oct 03 2005 - 17:32:03 EDT

  • Next message: Andrus Adamchik: "Re: flattened prefetches"

    On 10/3/05, Andrus Adamchik <andru..bjectstyle.org> wrote:
    > > In some cases, I'd agree - though in other cases I would not. For
    > > example, if I query across the relationship by path
    > > (query.addPrefetch("toHouse.toCity")), then when I invoke
    > > person.getToCity, it should work.
    >
    > Hmm... I haven't looked at the case of flattened relationships
    > overlapping with regular ObjRelationship. Maybe we should generally
    > treat them as cover methods without any DB magic? Otherwise you'd
    > have your object graph easily messed up (I had such bad experience
    > with EOF).

    Not following what you mean when you say cover methods..

    > It will be hard to guess performance impact of such decision as it
    > depends on many factors (the number of rows in each participating
    > table, db indexes, etc.) So we should concentrate on correctness
    > first. The simplest algorithm would be to use disjoint prefetches
    > unless we know that it won't give Cayenne enough info, and then
    > switch to joint. We can be "creative" and combine both types (i.e.
    > root table is fetched in its own query, related table is fetched in
    > combination with a joint table to avoid inner join inconsistencies
    > that I think I mentioned somewhere in the docs).
    >
    That seems to make the most sense. Regardless of the approach, it
    should follow the approach of allowing for a substituted Delegate to
    be provided by the user, maybe even on a per-query basis. That way the
    impact of making the "wrong" decision here is substantially reduced :)

    Cris



    This archive was generated by hypermail 2.0.0 : Mon Oct 03 2005 - 17:32:04 EDT