On Aug 31, 2013, at 7:33 PM, gbr <doubl...@directbox.com> wrote: > On Sunday, September 1, 2013 8:19:24 AM UTC+10, Michael Bayer wrote: > > Let me add a bit of information. I assumed the behaviour would be the same in > ORM (actually, when looking at the docs again I saw it's actually called > "subquery eager loading", i.e. issuing an additional query upon receiving a > bunch of table rows which other tables relate to). > The first query I sent is a join of other tables, has a where clause and a > CTE. The 2nd query also contains a CTE (the same as the 1st). I know the > columns to join on and can specify them. A result proxy is fine as a result. > > Oh, is it that easy? Is this the same for a subquery eager load? I tried to > use this, but ran into an issue (`CompileError: Multiple, unrelated CTEs > found with the same name`). I could use just one CTE, as they are the same > for both queries, but I don't know how to remove it from the subqueried > (query 1) query.
OK a subquery eager load we can do, because that started out as a recipe and you can see that here: http://www.sqlalchemy.org/trac/wiki/UsageRecipes/DisjointEagerLoading
signature.asc
Description: Message signed with OpenPGP using GPGMail