Re: entities with calculated fields

From: Juergen Saar (juerge..saar.org)
Date: Thu Feb 15 2007 - 06:48:44 EST

  • Next message: Michael Gentry: "Re: How to query a relationship"

    I'm not really sure about your needs ....

    For solving such kind of problem,
    we created views in the database.

    As far as we could do performance tests
    it seems, that it is the fastest way
    and if you have several software-products working
    on the same database, all products can
    have a benefit of this.

    In cayenne-repository the view
    is configured as readonly entity.

    Good luck ...
    --- Juergen ---

    2007/2/15, Aristedes Maniatis <ar..sh.com.au>:
    >
    > We are very close to a release of our software but we've hit a
    > performance problem in our approach to displaying a list of records.
    > We are fetching a list of courses and for each one showing the count
    > of enrolments. To do that, we are performing a second stored query to
    > do a count which is proving to be too slow since it requires a second
    > trip back to the database for each row.
    >
    > Is there a way to do this by creating runtime virtual entity which
    > represents a database view including that count column? Or for that
    > matter any other approach to this speed problem? Doing this as a raw
    > SQL fetch would obviously be quite quick since we could do this in
    > one SELECT statement including the embedded COUNT, but we'd rather a
    > Cayenne friendly option.
    >
    >
    > Ari Maniatis
    >
    >
    >
    >
    >
    > -------------------------->
    > ish
    > http://www.ish.com.au
    > Level 1, 30 Wilson Street Newtown 2042 Australia
    > phone +61 2 9550 5001 fax +61 2 9550 4001
    > GPG fingerprint CBFB 84B4 738D 4E87 5E5C 5EFA EF6A 7D2E 3E49 102A
    >
    >
    >
    >



    This archive was generated by hypermail 2.0.0 : Thu Feb 15 2007 - 06:49:32 EST