cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Hatch <>
Subject Re: cayenne performance tuning issues
Date Wed, 18 Dec 2013 04:09:34 GMT
I did testing with default prefetching disjoint joint semantics and joint
prefetching. As you stated, disjoint sends multiple SQL requests. I'm not
sure which scenario that would be preferred. Joint semantics seems to
create left joins, although I'd want inner joins. Is there an option to
prefetch and inner join? Didn't look to be the case
On Dec 17, 2013 9:50 PM, "Aristedes Maniatis" <> wrote:

> On 18/12/2013 4:29am, Michael Hatch wrote:
> > The first sql statement is fetching the user info, while the second sql
> is
> > for inflating the roles relationship. I understand the documentation
> > explicitly states that prefetching will inflate relationships for you,
> but
> > it still does so via multiple sql commands per relationship, instead of
> via
> > a single sql statement with an inner join. Did I simply do something
> wrong
> > somewhere?
> Cayenne will automatically decide whether to issue multiple SQL requests
> (disjoint prefetch) or one big SQL statement which captures all the data
> (joint). Don't assume without testing which one will be better for your
> needs, and Cayenne does allow you to choose which sementics to use. But
> SelectQuery will be disjoint by default.
> Imagine for a moment: to-many joins to 5 tables from a source table on
> which you want to use a joint prefetch. You can very quickly return a vast
> number of rows using an outer join in this way.
> Ari
> --
> -------------------------->
> Aristedes Maniatis
> GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message