On Wed, Oct 22, 2014 at 6:10 PM, Michael Bayer <[email protected]> wrote: > > Yeah, that's because the alternate tables have no correspondence to the > original one, the way a SELECT would. So without building some new kind of > core selectable that acts this way, these approaches won't work here. > > Based on your case that you do want a UNION that populates a collection that > is entirely straight User objects, that does imply these would be concrete > inheriting subclasses.
Yes, as I said before, that was my first attempt and it works, but generates queries with a WHERE clause is applied to the whole subquery formed by the UNIONs, and MySQL doesn't optimize that. Thanks for the insights anyway. I need this done soon, so I guess I'll keep working on my Query proxy and find a way to introspect and rebuild the binary expressions. As a last resort I can enforce the use of filter_by. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.
