Re: Problem concerning Prefetching

From: Michael Gentry (blacknex..mail.com)
Date: Mon Jan 28 2008 - 09:56:32 EST

  • Next message: Jean-Paul Le Fèvre: "Re: Problem concerning Prefetching"

    Hi Jean-Paul,

    It looks like galaxy -> galaxy_component_properties is a to-one
    relationship, which would cause Cayenne to issue multiple selects like
    this since it tries to resolve each fault individually.

    Given your manual SQL statement:

    select galaxies.number, galaxy_component_properties.mass_of_baryons
          from galaxy_component_properties
          join galaxies on galaxy_component_properties.galaxy_id = galaxies.id
          where some_clause
          order by galaxies.number;

    It looks like you don't actually care about having actual Cayenne
    objects (it looks like you only care about having two of the
    attributes)? If this is the case, you could use an SQLTemplate and
    raw data rows to only fetch in those two properties. If this isn't
    the case, let us know and we'll give you other ideas.

    Thanks,

    /dev/mrg



    This archive was generated by hypermail 2.0.0 : Mon Jan 28 2008 - 09:57:09 EST