Relationships that are really lazy

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Jan 28 2003 - 16:30:09 EST

  • Next message: Craig Miskell: "Re: Relationships that are really lazy"

    Another peformance feature I just thought of... Don't know when we can
    implement it (we have a pretty big queue already), just hope that someday
    I wake up and see it in Cayenne.

    Background:

    One of the TopLink applications that I am working on right now has a case
    when a to-many relationships resolves to potentially up to a 50 thousand
    objects. All of these objects need to be iterated through to do some work
    on them (normally just read their data). Performance (esp. memory use) of
    this is extremely poor since TopLink reads all the objects in memory.

    Current Solution:

    Instead of using relationships use queries. Cayenne (as well as TopLink)
    allows to optimize this with ResultIterators as well as paged queries.

    Object/Relational Solution:

    I think it would be cool to extend existing query solutions above to
    relationships. I can see two cases, that can be specified in the mapping:

      - Incremental fill.
      - Max objects.

    With incremental fill, this will work just like the paginated queries:

      http://objectstyle.org/cayenne/userguide/perform/index.html

    Reading all ObjectIds first, and resolving objects as needed. With "max
    objects", we may add a parameter that is a number of max objects in the
    array, "unfaulting" pages of objects once the number of faulted objects
    exceeds this number.

    I'll keep dreaming,

    Andrus



    This archive was generated by hypermail 2.0.0 : Tue Jan 28 2003 - 16:30:09 EST