Note that if your items have a lot of attributes and attachments, an outer-join will return a multiplicatively-large result set. That will get boiled down into a sane number of objects by the SqlAlchemy ORM, but your performance might be ugly in terms of I/O to your database, or the processing time it takes to allocate the entire result set. If the related tables are small, then querying all the data in a single query can be a lot faster.
Anyway, it would help to see some code and know if you are using just the Core, or if you are using the ORM and have relationships defined. You can pretty easily force an outer join on a relationship by setting the eager loading argument to "joined". If you are using queries directly, then Jonathan's suggestions above should get you where you need to go. On Tue, Mar 15, 2016 at 10:17 AM, Jonathan Vanasco <[email protected]> wrote: > The ORM has an `outerjoin` method on queries: > > http://docs.sqlalchemy.org/en/latest/orm/query.html#sqlalchemy.orm.query.Query.outerjoin > > You can also pass "isouter=True" to `join` > > http://docs.sqlalchemy.org/en/latest/orm/query.html#sqlalchemy.orm.query.Query.join > > The core supports an outerjoin in both variations as well: > > http://docs.sqlalchemy.org/en/latest/core/selectable.html?highlight=outer#sqlalchemy.sql.expression.Join.join > > http://docs.sqlalchemy.org/en/latest/core/selectable.html?highlight=outer#sqlalchemy.sql.expression.Join.outerjoin > > -- > 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 https://groups.google.com/group/sqlalchemy. > For more options, visit https://groups.google.com/d/optout. > -- 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 https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.
